Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Perl 6 release date

by hardburn (Abbot)
on Oct 11, 2002 at 13:38 UTC ( #204504=note: print w/ replies, xml ) Need Help??


in reply to Perl 6 release date

#!/usr/bin/perl # # I win # use warnings; use strict; foreach my $year (2003 .. 2010) { foreach my $month (1 .. 12) { foreach my $day (1 .. 31) { $month = "0$month" if($month < 10); $day = "0$day" if($day < 10); print "$year-$month-$day\n"; } } }

Sure, it has a few bugs, like not taking into account months with less than 31 days. It doesn't change the fact that I still win if perl6 is released between 2003 and 2010 :)


Comment on Re: Perl 6 release date
Download Code
Re: Re: Perl 6 release date
by Juerd (Abbot) on Oct 11, 2002 at 16:37 UTC

    New rule: only one entry per person :)

    Nevertheless, here's a different version:

    use POSIX qw(mktime strftime); my $end = mktime(59, 59, 23, 31, 11, 110); for (my $time = time; $time <= $end; $time += 86400) { print strftime "%Y-%m-%d\n", localtime $time; }

    - Yes, I reinvent wheels.
    - Spam: Visit eurotraQ.
    

Tomorrow.
by Falkkin (Chaplain) on Oct 11, 2002 at 16:40 UTC
    Mine beats yours -- it'll be right at least once, no exceptions. :)
    ($a,$a,$a,$d,$m,$y)=localtime(time+24*60*60); print $y+1900, "-", $m+1, "-$d";

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (18)
As of 2014-08-29 16:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (282 votes), past polls