例1
my @hairetu; my $i = 0; open(IN,"/home/zzz.txt"); while( my $Meigara = <IN> ) { chomp($Meigara); print $Meigara . "\n"; $hairetu[$i] = $Meigara; $i = $i + 1 } print @hairetu . "\n"; print $#hairetu . "\n"; $length = @hairetu; # print $length; for( $i=0 ; $i<@hairetu ; $i++ ) { print $hairetu[$i] . "\n"; }
例2
$FH = "/home/zzz.txt"; open FH; @list = <FH>; foreach $data_line( @list ){ print $data_line; }
例3
$datafile="/home/zzz.txt"; open(FH, $datafile); @list = <FH>; # 1行ごとに出力 foreach $data_line( @list ) { print $data_line; }
0 件のコメント:
コメントを投稿