Not obfuscation, just quirky.
Sometimes working in a compendium of Dilbert cartoons can be depressing.
At times like this I find it is a worthwhile experience to start wishing your life away, hell what's 100 days.
#!/usr/local/bin/perl
use Time::Local;
for($_=time;$_<timelocal(0,0,0,(split/\//,$ARGV[0])[0..2])+86400;$_+=8
+6400){
@_=localtime($_);$;++unless$_[6]==6||$_[6]==0}print"$; working days le
+ft.\n"
It's run from a cron script on the server with a date argument (DD/MM/YYYY) output redirected to my .plan file :^).
It tells me how many working days I have left in this contract,
I figure by the time my manager's figured out what this code does,
Dr Zaius will be squeezing into 54" waist Lederhosen.
I wouldn't recommend using this algolrithm to find the number of working days between two points as it doesn't scale very well.
Gagh I got bored:
#!/usr/local/bin/perl
use Time::Local;$,+=(localtime($^T+=86400))[60]!~/[60]/while$^T-86400
<timelocal 0,0,0,split'/',$ARGV[0];print''," working days left\n"#:^)
--
Brother Frankus.
¤
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.