Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

dwm042's scratchpad

by dwm042 (Priest)
on Oct 26, 2007 at 20:07 UTC ( [id://647486]=scratchpad: print w/replies, xml ) Need Help??

my @months = qw{ May Jun }; my @end_of_month = ( 31, 30 ); my $start_day = 16; my $end_day = 3; my $end_month = $months[1]; my $incr = date_initialize( $start_day, \@months, \@end_of_month); for ( my ($day, $month) = ( 16, "May") ; $day != $end_day or $month n +e $end_month ; ( $day, $month ) = $incr->() ) { # # do stuff # } # # set up incrementer. This function returns a reference to an indexing + function. # sub date_initialize { my $day = shift; my $monthref = shift; my $endmonthref = shift; my $month_index = 0; return sub { $day++; if ( $day > $$endmonthref[$month_index] ) { $day = 1; $month_index++; } return ( $day, $$monthref[$month_index] ); } }
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (5)
As of 2024-03-29 00:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found