Hi Monks!
I am trying to build a list with all the name of the months of the year using "Time::Piece". I also noticed in the docs this "Time::Piece::month_names(@months);", any idea how to use that to get the name of all the months? Trying with this, but its not working:
#!/usr/bin/perl
use strict;
use warnings;
use Time::Piece;
use Time::Piece::month_names(@months);
my $t = Time::Piece->new();
my $mon = $t->mon;
my $month = $t->monthname;
my $year = $t->year;
my @all_months = map sprintf( "%s", $_, $month ), 1 .. 12; # $mon
foreach my $month ( @all_months ) {
print "$month\n";
}
Thanks!