Help for this page

Select Code to Download


  1. or download this
    my( $width, $height ) = unpack 'I2', substr $data, $offset, 8;
    
  2. or download this
    print "$width : $height";
    327680 : 262144;
    
  3. or download this
    printf "%u : %u\n", unpack 'V2', substr $data, $offset, 8;
    1280 : 1024
    
  4. or download this
    ## Assume the first 8 bytes are a double in the 'other' endianess. 
    ##  And the next 4 a float.
    ...
    ## And unpack
    my $double = unpack 'd', $doublePackMyEndian;
    my $float  = unpack 'f', $floatPackedMyEndian;