Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

got perl?

by ginseng (Pilgrim)
on Jul 31, 2001 at 12:43 UTC ( #101101=obfuscated: print w/ replies, xml ) Need Help??

Ok, i've been hanging out here almost two months, and I guess sooner or later I have to do a JAPH obfu, right? Is there any tradition of writing these when there's more pressing, productive things to do? If so, I've been true to tradition...
#!/usr/bin/perl -w use strict;my% g = ('D\J{N]QRR\&S.HAy7z9 r['=>' => got perl ? <= ');my@ o = keys%g;my@ t = split"",(shift@o);my$ p = pack'c',74;my$ e = sub{while(@_){my$ r = shift;$!=unpack'c',$r;my$ l = shift;$p.=substr$!,(unpack'c',$l)/10, (unpack'c',$l)%10;}}; &$e(@t);print$p,$/;

Despite use strict, it may not work on versions of perl with drastically different error messages ;)

Update: As chipmunk has pointed out, this code relies on system error messages, not Perl error messages. As a result, it will only run properly on a FreeBSD 4.x system. (By pure luck, it's been tested on 4.1 and 4.3, but only because I happened to upgrade my system between printing out the error messages and actually writing the code.)

So consider my first JAPH a real learning experience, and a bit more obfuscated than planned - even when it runs, one does not know what it did ;-)

Maybe I should have called it "Got FreeBSD?"

Thanks, chipmunk!

Comment on got perl?
Select or Download Code
Re: got perl?
by chipmunk (Parson) on Jul 31, 2001 at 21:09 UTC
    The $! variable is actually used for system error messages. The version of perl doesn't really matter; it's the OS and platform that determine whether or not this JAPH will produce the proper output.

    For example, on a machine running RedHat linux, I get:

    substr outside of string at tmp.pl line 14. Use of uninitialized value in concatenation (.) or string at tmp.pl li +ne 14. substr outside of string at tmp.pl line 14. Use of uninitialized value in concatenation (.) or string at tmp.pl li +ne 14. J edretig no hial
    And on another machine running IRIX, I get: J eemp tocrdrnots i f
    I'm afraid it just doesn't make sense to rely on the value of $! for a JAPH.
      Ahah! You're quit correct then that it doesn't make sense to rely on the value of $!.

      Yes, I saw that and still thought Perl was creating the messages. My bad. It's not like I couldn't have tested it on OpenBSD and Linux instead of just the FreeBSD I wrote it on - alas, I was lazy.

      Well, I guess that makes this code even more obfuscated... even when it runs, one does not know what it did! ;-)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: obfuscated [id://101101]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (5)
As of 2015-01-26 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (186 votes), past polls