in reply to Woes with binmode

This statement:
printf OUTFILE ("%08x\n", $out);
emits an 'ASCII' (text) representation of a number. I think you want something like:
print OUTFILE pack('L', $out);
which emits a more traditional 'binary' representation. See the documentation on pack for details on what formats for numbers are available.

perl's binmode has nothing to do with how numbers are printed but with how perl converts characters to octet sequences (bytes). That said, you'll want to use binmode when printing data generated from pack since pack produces binary data and not text.

Replies are listed 'Best First'.
Re^2: Woes with binmode
by sf_ashley (Sexton) on Mar 20, 2008 at 19:23 UTC

    Brilliant, this does the trick perfectly. I will have to consult the alpaca and see how the 'pack' function exactly works, but for the mean time my problem is solved.

    My sincere thanks for your help.