while(<$input>) { chomp; my $var = pack("H*", $_); die "holy smokes, my hex-dump file is bad" unless length $var == 32; }