出力先が名前付きパイプとかファイルとかだと、バッファリングされてしまうっぽい。
なので、バッファリングさせないようにする。
$ cat hoge.pl #!/usr/bin/perl open my $fh, "> hoge"; select((select($fh), $|=1)[0]); # $fh をバッファリングさせない while(<>){ print $fh "$_"; }
出力先が名前付きパイプとかファイルとかだと、バッファリングされてしまうっぽい。
なので、バッファリングさせないようにする。
$ cat hoge.pl #!/usr/bin/perl open my $fh, "> hoge"; select((select($fh), $|=1)[0]); # $fh をバッファリングさせない while(<>){ print $fh "$_"; }