Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Months of the year

by kennethk (Monsignor)
on Mar 31, 2014 at 19:02 UTC ( #1080431=note: print w/ replies, xml ) Need Help??


in reply to Months of the year

The line from the docs

Time::Piece::mon_list(@months);
Means that if you want to change the months list (for perhaps localization or internationalization), this is the API. If you just call the method with no arguments, you get the list of months:
my @months = Time::Piece::mon_list;
or
my $t = Time::Piece->new(); my @months = $t->mon_list;

#11929 First ask yourself `How would I do this without a computer?' Then have the computer do it the same way.


Comment on Re: Months of the year
Select or Download Code
Re^2: Months of the year
by Anonymous Monk on Mar 31, 2014 at 19:14 UTC
    Thats a lot less code, now is trying to get the full name of the months with:
    my @months = $t->fullmonth;
    Not that easy I guess. It only gives the full name of the current month.
      use Time::Piece; use feature 'say'; my $t = Time::Piece->strptime('1', '%m'); for ( 0..11 ) { say $t->add_months($_)->fullmonth }

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2014-09-15 03:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite cookbook is:










    Results (145 votes), past polls