[Israel.pm] JAPH signature

Srikanth Madani srikmadani at yahoo.com
Wed Mar 29 05:56:02 PST 2006


Hi all,

whilst cleaning up an old Unix account of mine, I
found a Perl signature I'd written ages ago. I hacked
at it, and was able to remove a print statement.

Here it is:

      $_=  "87 69S69E75C69S78 68A32W73A83Y32!"  ;(
    $S,$R,$I,$K,         $w,$a,$s,         $H,$ER,$E
  )=(localtime,join"",map(chr,split/\D/));print$E,$s>4
?HERE:435660-86400*$s-3600*$i-60*$R-$S,join"",split/\d+/

(I hope my email client doesn't unnecessarily warp
it!)

With the whitespace removed, the one liner is:

perl -e '$_="87 69S69E75C69S78
68A32W73A83Y32!";($S,$R,$I,$K,$w,$a,$s,$H,$ER,$E)=(localtime,join"",map(chr,split/\D/));print$E,$s>4?HERE:435660-86400*$s-3600*$i-60*$R-$S,join"",split/\d+/'

What does it do? It prints the number of seconds left
till the weekend. If it's already the weekend (anytime
between 0001 on Friday till 2359h on Saturday) it
merely announces the fact.

Here are two sample outputs (one example of each
case):

WEEKEND IS 175012 SECS AWAY!
WEEKEND IS HERE

Comments and suggestions for improvement welcome.

Cheers,
Srikanth Madani

The difference between a good haircut and a bad one is
seven days.


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the Perl mailing list