programming-examples/perl/File/Win32 Binary Files.pl

18 lines
298 B
Perl
Raw Normal View History

2019-11-15 12:59:38 +01:00
#binmode FILEHANDLE
#binmode FILEHANDLE, DISCIPLINE
$infile="a.gif";
open( INFILE, "<$infile" );
open( OUTFILE, ">out.gif" );
binmode( INFILE );
binmode( OUTFILE );
while ( read( INFILE, $buffer, 1024 ) ) {
print OUTFILE $buffer;
}
close( INFILE );
close( OUTFILE );