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

Re: Binary value of string

by BrowserUk (Patriarch)
on Jul 11, 2011 at 19:08 UTC ( [id://913756] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $sum = 0; 
    $sum += $_ for unpack 'C*', "This is a string to change to binary"; 
    print $sum;;
    3325
    
  2. or download this
    print unpack '%32C*', "This is a string to change to binary";;
    3325
    
  3. or download this
    print unpack '%64C*', "This is a string to change to binary";;
    3325