アウトプットができる技術者に

it's a time to take a new step !

2014-02-26から1日間の記事一覧

Perl Tips ファイル読み込んで、配列で回す

なんかよくやるので、メモ。 #!/usr/bin/perl open(OUT, "> tmp/out.txt"); print OUT "1,a \n"; print OUT "2,b \n"; print OUT "3,c \n"; close OUT; open(IN, "< tmp/out.txt"); @line = <IN>; close IN; foreach (@line){ chop; #remove return code ($code,</in>…