c:\@Work\Perl>perl -wMstrict -le "use Data::Dump qw(pp); ;; for my $s ('a1', qq{\x{1f}s}) { print q{'H*' found 0x13! in }, pp($s) if unpack('H*', $s) =~ /13/; print q{'h*' found 0x13! in }, pp($s) if unpack('h*', $s) =~ /13/; } " 'H*' found 0x13! in "a1" 'h*' found 0x13! in "a1" 'h*' found 0x13! in "\37s"