BEGIN { $| = 1 } while( read(*STDIN, my $buffer, 1 )){ printf "%02X ", unpack "C", $buffer; }