This is more of a
thank-you note than a cool use for perl. But since I think it IS
cool, here we go:
With the help of
httptech,
mdillon,
chromatic,
Corion and others (the list gets long), I managed to
unpack image files in hex mode, and embed them directly into a perl script. This will allow me to build a self-sufficient script, without the need for extra image files in HTML, and make it as simple as can be to install the script on any server. All you have to do, is upload one file, chmod it, and its ready to go. When the script is called with a ?img=foo it re-
packs the image and sends it back to the client. There are a few obvious downsides to this, but for small scripts, small images, I think its a pretty clever way to be user friendly.
So, without further ado, you can get the source at
http://johnny.warp.psi.br/images.txt, and you can see the ouput images (all shamelessly "borrowed" from Apache)
here,
here,
here and
here!
Thanks again everyone! I had a great time learning on this one. Peers are the best teachers.