#!/usr/bin/perl # convert ascii to and from hex # jason t if ($ARGV[0] eq "-d"){ while(){ s/([0-9a-fA-F]{2})/pack("H2",$1)/ge; print; } } else { while(){ s/(.?)/unpack("H2",$1)/ge; print; } }