in reply to On Challenging Ways to Learn Perl

I used the windows bitmap format with perl once in this windows bitmap that's also a perl program. It's quite trivial.

Replies are listed 'Best First'.
Re^2: On Challenging Ways to Learn Perl
by mobiusinversion (Beadle) on Mar 28, 2008 at 04:29 UTC
    Ha! I actually find that to be clever. The bmp contents might be trivial but I can safely say I've never seen that before. I can imagine awesome extensions to that. Like obfuscated code inside of a more elaborate, even colorful bmp. A png or jpeg would be fabulous at that.

    Seems to me that finding code whose bytes also rendered a nontrivial image, or making and image that incidentally yielded nontrivial code would be tantamount to a very hard fixed point problem...

      A PNG can't work, because it starts with a header that raises a syntax error in perl (unless you use some command-line switches). A GIF may, but I was lazy to do that. I don't know about JPEG, TIFF, or other image formats.

        The following headers are from filext. I believe the are all in little endian hex...
        TIFF : 49 49 2A 00 JPEG : FF D8 FF MIFF : 69 64 3D 49 6D 61 67 65 4D 61 67 69 63 6B MNG : 8A 4D 4E 47 0D 0A 1A 0A 00 00 00 1C 4D 48 44 52 RAW : 6D 68 77 61 6E 68 00 04 SVG : 3C DJVU : 41 54 26 54 46 4F 52 4D 00 ICO : 00 00 01 00 PBM : 50 34 0A PSD : 38 42 50 53 00 01 00 00 00 00 00 00 00
        Your thoughts?