Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Using pack to evaluate text strings as hexadecimal values

by polettix (Vicar)
on Mar 07, 2006 at 13:02 UTC ( #534904=note: print w/ replies, xml ) Need Help??


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.


Comment on Re: Using pack to evaluate text strings as hexadecimal values
Select or Download Code
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://534904]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2014-09-03 07:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (35 votes), past polls