Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: [OT] Perl Code Embedded in an Image

by ambrus (Abbot)
on Oct 06, 2005 at 21:31 UTC ( [id://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.)

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (2)
As of 2025-06-22 01:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.