Help for this page

Select Code to Download


  1. or download this
    print map{hex} (split'', unpack 'h4', $n)[2,3,0,1];                 
    #! Gives >> 15 0 0 15
    ...
    #! Gives >> 15 0 0 15
    $n = unpack 'n', $n; print map{ ($n >>( 4 * $_ )) & 0xf } 0 .. 3;   
    #! Gives >> 15 0 0 15
    
  2. or download this
    #! perl -slw
    use strict;
    ...
    unpack_map_shift_and_list      15328/s   109%    49%   19%     18%    
    + --
    
    C:\test>