in reply to Re^3: Question about binary file I/O
in thread Question about binary file I/O
Well, using this seemed to work:
my $NewTileData = pack 'v', ((unpack 'v',$TileData) & 0xFC7F) | $GFXFileBits;
Perhaps I was just misunderstanding the pack and unpack functions? The way perldoc words the explanation of them suggest that pack always returns a string and unpack always returns a list of values, neither of which I would want in this context. Thank you all for the help, in any case. (I am still confused about how pack and unpack work and what they return depending on the template, though...)