for (split //, $str) { printf( "%s: %02x\n", (/[[:print:]]/) ? $_:".", ord()); }