binmode
binmode FILEHANDLE
FILEHANDLEのファイルをバイナリモードで扱うようにします。バイナリファイルとテキストファイルを区別しないOSでは何もしません。
サンプルプログラム
open my $fh, 'hoge.bin' or die;
binmode $fh;
while (read $fh, $buf, 1024) {
# $bufを使う処理
}
close $fh;
関連項目
・close関数・open関数
open my $fh, 'hoge.bin' or die;
binmode $fh;
while (read $fh, $buf, 1024) {
# $bufを使う処理
}
close $fh;