in reply to Woes with binmode
emits an 'ASCII' (text) representation of a number. I think you want something like:printf OUTFILE ("%08x\n", $out);
which emits a more traditional 'binary' representation. See the documentation on pack for details on what formats for numbers are available.print OUTFILE pack('L', $out);
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 |