in reply to Re^3: Question about binary file I/O
in thread Question about binary file I/O
$TileData is still a string instead of a number, so it doesn't work with the bitwise operators.{ local $/ = \2; my $TileData = 0x0000; while(my $TileData = <$fhin>) { if(length($TileData) != 2) { warn "Warning: The input file had an uneven length. Last +byte read: $TileData."; last; } my $NewTileData = (($TileData & 0xFC7F) | ($GFXFileBits)); print {$fhout} $NewTileData; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: Question about binary file I/O
by eyepopslikeamosquito (Archbishop) on Feb 06, 2011 at 07:18 UTC |