Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^3: converting artibrary binary data to numeric values

by Corion (Pope)
on Oct 01, 2012 at 20:17 UTC ( #996736=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    use Data::Dumper;
    my $str = "\x0D\x0E\x0A\x0D\x0B\x0E\x0E\x0F";
    ...
    
    my $num = unpack 'N', pack 'C4', @bytes;
    print sprintf "%08x (%i)", $num, $num;
    
  2. or download this
    my $str = "\xDE\xAD\xBE\xEF";
    my $num = unpack 'N', $str;
    print sprintf "%08x (%i)", $num, $num;
    

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (7)
As of 2014-12-25 13:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (160 votes), past polls