Can someone tell me how binmode in Perl can be used to achieve the same function as following one-liner, so as to print out the hex data of one text ?
$ perl -nle 'print map {sprintf "%02X",ord} split //'
For example, if I input "abcABC", the output will be "616263414243".
Please give a similar one-liner using binmode.
Thanks.