Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I'm pretty sure the problem will be with my style. I simply cant find whats wrong with it? The output is belowuse strict; use warnings; ### Date my ($sec,$min,$hour,$mday,$month,$year,$wday,$yday,$isdst) = localtime +(); $year += 1900; $mday -= 1; if ($mday == 0) { $month -= 1; } if ($month == 1||3||5||7||8||10||12) { $mday = 31; } elsif ($month == 4||6||9||11) { $mday = 30; } elsif ($month == 2) { print "is this a leap year"; } if ($month == 0) { $year -= 1; $month = 12; } print ($sec."\n",$min."\n",$hour."\n",$mday."\n",$month."\n",$year."\n +",$wday."\n",$yday."\n",$isdst."\n");
It should read as:56 45 11 31 7 2013 5 213 1
56 45 11 1 7 2013 5 213 1
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Date function
by toolic (Bishop) on Aug 02, 2013 at 15:59 UTC | |
by Anonymous Monk on Aug 02, 2013 at 16:15 UTC | |
by toolic (Bishop) on Aug 02, 2013 at 16:27 UTC | |
by Anonymous Monk on Aug 02, 2013 at 17:34 UTC | |
by Anonymous Monk on Aug 03, 2013 at 06:16 UTC | |
|
Re: Date function
by CountZero (Bishop) on Aug 02, 2013 at 16:47 UTC | |
by BillKSmith (Monsignor) on Aug 02, 2013 at 19:50 UTC | |
|
Re: Date function
by Cristoforo (Curate) on Aug 02, 2013 at 16:55 UTC | |
by Anonymous Monk on Aug 02, 2013 at 17:33 UTC | |
by Cristoforo (Curate) on Aug 02, 2013 at 20:24 UTC | |
by Anonymous Monk on Aug 06, 2013 at 13:14 UTC | |
|
Re: Date function
by Laurent_R (Canon) on Aug 02, 2013 at 17:58 UTC | |
|
Re: Date function
by cursion (Pilgrim) on Aug 02, 2013 at 20:52 UTC | |
by tobyink (Canon) on Aug 03, 2013 at 14:54 UTC | |
|
Re: Date function
by ww (Archbishop) on Aug 02, 2013 at 19:24 UTC |