Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

dwm042's scratchpad

by dwm042 (Priest)
on Oct 26, 2007 at 20:07 UTC ( #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
Chatterbox?
[stevieb]: I've finally added the ability for berrybrew to fetch the list of perls available directly from Strawberry's releases.json file. Instead of pulling from there on every single call, I've added a berrybrew fetch, so it's only updated..
[stevieb]: ...on request. There's some supporting work I need to do, as well as update the docs, but it's in the v1.12 branch if anyone wants to play with it...
[stevieb]: ...issue 62 will track what else needs to be done.

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2017-03-31 01:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (364 votes). Check out past polls.