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

Re: countdown to U1e9

by BooK (Curate)
on Jul 12, 2001 at 01:27 UTC ( #95860=note: print w/replies, xml ) Need Help??


in reply to countdown to U1e9

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.

Replies are listed 'Best First'.
Re: Re: countdown to U1e9
by Anonymous Monk on Jul 12, 2001 at 06:51 UTC
    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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://95860]
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 2023-03-24 16:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (61 votes). Check out past polls.

    Notices?