2014年3月4日火曜日

開発環境

初めてのPerl 第6版 (Randal L. Schwartz (著)、brian d foy (著)、Tom Phoenix (著)、近藤 嘉雪 (翻訳)、オライリージャパン)、5章(入出力)の5.13(練習問題)1.を解いてみる。

その他参考書籍

5.13(練習問題)1.

コード(BBEdit, Emacs)

sample.pl

#!/usr/bin/env perl
# use diagnostics;
use strict;
use warnings;
use 5.016;
use utf8;
binmode STDIN, ':utf8';
binmode STDOUT, ':utf8';
binmode STDERR, ':utf8';

print reverse <>

入出力結果(Terminal)

$ ./tac.pl fred barney betty
betty5
betty4
betty3
betty2
betty1
barny5
barny4
barny3
barny2
barny1
fred5
fred4
fred3
fred2
fred1
$ cat fred barney betty
fred1
fred2
fred3
fred4
fred5
barny1
barny2
barny3
barny4
barny5
betty1
betty2
betty3
betty4
betty5
$

0 コメント:

コメントを投稿