Very nice. BTW, ascii_to_hex($str) is just unpack('H*', $str) and hex_to_ascii($str) is just pack('H*', $str). Those functions are incorrectly named because, as you've discovered, the input doesn't have to be ascii. pack is kind of tricky, but it would help you if you studied its ways.
Thanks for the time and effort, reviewing my script. You are absolutely right. I checked the source of the script and it is actually that simple.
Well it is easier for me to use the lexical methods instead of creating my own subroutines and call them inside the script. But you gave me a nice idea on how to proceed.
Thanks again for your time and effort, BR.
Seeking for Perl wisdom...on the process of learning...not there...yet!