Beefy Boxes and Bandwidth Generously Provided by pair Networks Bob
The stupid question is the question not asked
 
PerlMonks  

Re: how can i find number of days in a given year and month

by grinder (Bishop)
on Jul 16, 2001 at 19:31 UTC ( [id://97148]=note: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.


in reply to how can i find number of days in a given year and month

#! /usr/bin/perl -w use strict; use Date::Calc qw/Days_in_Month/; while( <DATA> ) { chomp; my( $year, $month ) = split; my $days = eval { Days_in_Month( $year, $month) }; $days = 'who knows?' if $@; print "$year/$month => $days\n"; } __DATA__ 1996 1 1996 2 1998 2 2000 2 1900 2 1600 2 2001 2 2001 7 2001 12 2001 13 2001 0

hint: if you know your data are clean then you can omit the eval and error check.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://97148]
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.