One of my favorite uses for perl is writing one-liners to convert to/from binary, hex, and octal, to send geek-coded messages on the Free Internet Chess Server.

for example:

perl -e'print pack("B*","01010000011001010111001001101100001000 00010100100110111101100011011010110111 0011001000010010000100100001");'

Note that that's all one line, the breaks are to fit it in small browser screens and should be removed

Replies are listed 'Best First'.
RE: Geek Speak
by Keighvin (Novice) on Apr 25, 2000 at 22:02 UTC
    How do you get it into Binary in the first place? I'm not very good w/pack, I just know a couple of canned uses. Know of any cool primers out there?
      You just unpack the ascii for that.
      perl -e'print unpack("B*","Perl Rocks!"),"\n"'
      Will do the trick. See the Library, in the the perl funtion manual it lists the other convertions pack and unpack can do. For long messages, hex is often a better choice.