in reply to HexDump.pm

## convert non printable chars to '.' for a string sub printablestr { my $str = shift; $str =~ s/[^\x20-\x7f]/./g; return $str; } ## hex dump utility function sub hd { my(@retList, $len, $width, $i, $str); $width = $ENV{HEXDUMP_WIDTH} || 16; $i = 0; $str = ''; foreach( @_ ) { while( my $str = substr($_, $width*$i, $width) ){ $len = length($str); push @retList, sprintf("%04X ".('%02X ' x $len ).(' 'x($width - $len))." +%s\n", $width*$i++, map({ord} split//, $str), printablestr($s +tr)); last if $len < $width; } } return $retList[0] unless wantarray; return @retList; }

--
I'm not belgian but I play one on TV.