Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

Re: [OT] Perl Code Embedded in an Image

by ambrus (Abbot)
on Oct 06, 2005 at 21:31 UTC ( #498060=note: print w/ replies, xml ) Need Help??

in reply to [OT] Perl Code Embedded in an Image

Without having known about your post, I wondered on the same thing a few months later.

I wanted an image that runs as a perl script without the -x switch or any other switches.

First, I've decided that this was impossible to do with a PNG image, because perl chokes right away on its header.

Then, I was looking at GIF, but I've found the specs too complicated, so I took it away.

I've however produced a BMP (windows bitmap) that doubles as a JAPH. BMP is now displayed in most browsers, however it's not allowed to upload one as a monk image (maybe because when this was decided, Netscape 4 which doesn't have BMP support, was still common back then). Thus, I can only show this image off-site: japh.bmp.

To try the perl part, download it and run with perl japh.bmp.

(The japh this one has is a trivial one, but I can change it to any perl code of course.)

Comment on Re: [OT] Perl Code Embedded in an Image
Download Code
Replies are listed 'Best First'.
Re^2: [OT] Perl Code Embedded in an Image
by ambrus (Abbot) on Feb 16, 2012 at 11:48 UTC

    I want to upload a copy of that file here in case you can't reach the external server. However, I don't want to just include it in code tags because that could break it (by eg. mangling newline characters).

    Thus, here's a perl script that you should run to reproduce the script: redirect its output to a file, say japh.bmp, then run the resulting file with perl like perl japh.bmp and/or view it with some image viewer program.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://498060]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (11)
As of 2015-12-01 19:14 GMT
Find Nodes?
    Voting Booth?

    My keyboard shows this many letters:

    Results (25 votes), past polls