Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

countdown to U1e9

by Anonymous Monk
on Jul 10, 2001 at 03:37 UTC ( #95203=obfuscated: print w/ replies, xml ) Need Help??

This is my first (and probably last) JAPH. I didn't go crazy with it -- I was making something useful for myself and got carried a little away. It's only useful to you if you're concerned about unix time values rolling over in september of this year (thanks merlyn .. i got the idea from your webpage). Direct comments are OK if anyone has any:
perl -e '$output=pack("C*",10,109,121,32,36,110,111,119,61,116,105,109 +,101,40,41,59,10,109,121,32,36,116,97,114,103,101,116,61,39,49,48,48, +48,48,48,48,48,48,48,39,59,10,109,121,32,40,36,115,101,99,44,36,109,1 +05,110,44,36,104,114,115,44,36,100,111,109,44,36,109,111,110,44,36,12 +1,101,97,114,44,36,119,100,97,121,44,36,121,100,97,121,44,36,105,115, +100,115,116,41,61,108,111,99,97,108,116,105,109,101,40,36,116,97,114, +103,101,116,32,45,32,36,110,111,119,41,59,10,109,121,32,36,110,111,11 +9,95,115,116,114,105,110,103,61,108,111,99,97,108,116,105,109,101,40, +116,105,109,101,40,41,41,59,10,109,121,32,36,116,97,114,103,101,116,9 +5,115,116,114,105,110,103,61,108,111,99,97,108,116,105,109,101,40,36, +116,97,114,103,101,116,41,59,10,109,121,32,36,109,101,115,115,97,103, +101,61,113,113,123,116,111,100,97,121,32,105,115,32,36,110,111,119,95 +,115,116,114,105,110,103,92,110,36,109,111,110,32,109,111,110,116,104 +,115,32,36,100,111,109,32,100,97,121,115,32,36,104,114,115,32,104,111 +,117,114,115,32,36,109,105,110,32,109,105,110,117,116,101,115,32,36,1 +15,101,99,32,115,101,99,111,110,100,115,32,108,101,102,116,32,116,105 +,108,108,32,85,49,101,57,32,40,36,116,97,114,103,101,116,95,115,116,1 +14,105,110,103,41,92,110,74,117,115,116,32,97,110,111,116,104,101,114 +,32,80,101,114,108,32,72,97,99,107,101,114,92,110,115,99,111,111,112, +101,114,92,64,97,98,115,111,108,117,116,101,109,97,100,110,101,115,11 +5,46,99,111,109,92,110,125,59,10,112,114,105,110,116,32,36,109,101,11 +5,115,97,103,101,59,10);eval $output;'
Hope it still runs after going through the system. It's my first post here :-)

Comment on countdown to U1e9
Download Code
Re: countdown to U1e9
by miyagawa (Chaplain) on Jul 10, 2001 at 14:02 UTC
Re: countdown to U1e9
by BooK (Curate) on Jul 12, 2001 at 01:27 UTC

    This section is about obfuscation, not about the chr function...

    Furthermore, obfuscated code often tends to compress code, rather than expanding it (by a factor of 3.7, if I did count correctly)... I won't mention other things, like elegance, artistry, clever use of little known features, etc...

    printf $message, scalar(localtime), localtime($then - time), scalar localtime $then;

    Pretty clever, indeed.

      Yep. It could be more compressed, and a lot more esoteric. But the point is the countdown to U1e9. I wanted obvious (KISS), not really obfuscated -- it's the message that counts.

        I understand. But obvious doesn't belong to this section (obviously). ;-)

        This is supposed to be obfuscated. The message is less important than how you manage to print it. Look at the message all (sometimes not much more obfuscated than your own) the others print: "Just another Perl hacker". Frankly, that isn't an interesting message at all.

        The trick in your code is that you count the delay as an offset to Jan 1, 1970. So you could get the difference in month, years, etc. with very simple calculation (none), since everything is done by localtime. That can be useful to others, and would be better explained in a section like Snippets or Cool Uses for Perl. A lot of people are suspicious about obfuscation (I wonder why.) and might not learn this trick if it's hidden here.

        By the way, you should get a username. You'd get more out of the site if the site could remember you.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (7)
As of 2014-07-23 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (138 votes), past polls