in reply to Hex string output

I think your being bitten by Unicode conversion. You could try using :raw on the open

open FILE, '>output.dat:raw' or die $!;

or using binmode on FILE before writing to it.


Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham
"Think for yourself!" - Abigail

Replies are listed 'Best First'.
Re: Re: Hex string output
by zengargoyle (Deacon) on Oct 08, 2003 at 04:41 UTC

    i'm never sure about binmode, never had to use it. same with utf8, but that's where your problem lies. go check out perldoc perldelta and see what it says about utf8

    $ perl -e '$f="\xff\x01\x67";print $f' | od -t x1 0000000 ff 01 67 0000003 $ perl -e '$f="\xff\x01\x67";use Encode; $f=encode("utf8", decode("iso +-8859-1",$f));print $f' | od -t x1 0000000 c3 bf 01 67 0000004
Re: Re: Hex string output
by Anonymous Monk on Oct 08, 2003 at 19:42 UTC
    binmode FILE

    solved my problem... thanks for the help, everyone. It was indeed that nasty business with the utf8/RedHat 9/Perl 5.8.0