Help for this page

Select Code to Download


  1. or download this
    print unpack 'C*', pack '(B8)*', map{ 
           substr '00000000'.$_, -8 
    } unpack 'A1A3A4',unpack 'B*',pack 'C', 162;;
    
    1 2 2
    
  2. or download this
    ## pack 162 into an 8-bit binary value (a char).
    pack 'C', 162       
    ...
    
    ## and convert those to ascii-decimal for display
    print
    
  3. or download this
    #! perl -slw
    use strict;
    ...
    1
    2
    2