http://qs1969.pair.com?node_id=124635


in reply to One-liner ascii/bin

What do you mean by bin?

There are many possible things you could mean, and they have very different answers. For instance you could be looking for an encryption module, of which there are several on CPAN. Or you might be looking for pack and unpack. If you are on Windows try this:

perl -ne "print unpack("B*", $_)" input_file > output_file
(Use single quotes on Unix.)

You can reverse it with:

perl -ne "print pack("B*", $_)" input_file > output_file
See pack, unpack, and perlrun for more.