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