if (@ARGV) { open ICO, ">", shift or die $!; } else { *ICO= *STDOUT; } binmode ICO; while () { chomp; print ICO pack "H*", $_; } # Create new hex data with # perl -wle "binmode STDIN; $/ = \32; while (<>) {print unpack 'H*', $_}"