http://www.perlmonks.org?node_id=534904


in reply to Using pack to evaluate text strings as hexadecimal values

You don't need pack, you need hex:
shell$ perl -e 'print hex("E000"), "\n"' 57344
You also need to use & (binary-wise and) instead of && (logic-wise and).

Flavio
perl -ple'$_=reverse' <<<ti.xittelop@oivalf

Don't fool yourself.

Replies are listed 'Best First'.
Re^2: Using pack to evaluate text strings as hexadecimal values
by davis (Vicar) on Mar 07, 2006 at 14:46 UTC
    Perfect, exactly what I wanted. Thanks very much!

    davis
    Kids, you tried your hardest, and you failed miserably. The lesson is: Never try.