Help for this page

Select Code to Download


  1. or download this
    my @converted_list = map { sprintf('0x%04x', $_) } unpack('v*', $line)
    +;
        
    ...
       print OUTFILE "$_, ";
       print OUTFILE "\n" unless ++$ctr % 8;
    }
    
  2. or download this
    my $ctr;
    print map { ++$ctr % 8 ? "$_, " : "$_\n" }
          map { sprintf('0x%04x', $_) }
          unpack('v*', $line);
    
  3. or download this
    # Each line has 8 16-bit words, so 16 bytes.
    local $/ = \16;
    ...
             unpack('v*', $_);
       print("\n");
    }