On Wed, 25 Jun 2003 16:23:21 -0300
James Oakley
Or with a regex:
And here is another handy file dumper which is kind-of cool. It prints each line of the file, followed by 2 lines with the hex value of the character, aligned vertically under each character. Once you get used to it, it's very easy to read. #!/usr/bin/perl -wnl012 # Prints the contents of a file a line at a time # followed by the ASCII value of each character in vertical columns. # Useful for debugging. # If no filename is specified then input is read from the keyboard. print; # Print the line we've just read @hexvals = map {sprintf "%02X", ord $_} split //; # Get hex value of each char for $a (0, 1) {print map {substr $_, $a, 1} @hexvals} # Print the hex values. #print "\n"; -- use Perl; #powerful programmable prestidigitation