Marshall has asked for the wisdom of the Perl Monks concerning the following question:
#usr/bin/perl -w use strict; use Data::Dumper; #core Perl module use Time::Local; #core Perl module #This "sort of works", but not completely my @valid_dates = #timegm( $sec, $min, $hour, $mday, $mon, $year ) [timegm (0,0,16,4,10, 2014), timegm (0,0,22,5,10,2014)], #2014 [timegm (0,0,16,5,10, 2013), timegm (0,0,22,6,10,2013)], #2013 [timegm (0,0,16,6,10, 2012), timegm (0,0,22,7,10,2012)], #2012 ; print Dumper \@valid_dates; __END__ prints: $VAR1 = [ [ 1415116800, 1415224800 ] ];
which I think is right as far as it goes. I want a array of arrays and this doesn't seem to do it. I am perplexed as to why the first line of the array def "works" and the rest do not?
There are no compile errors with this code.
I can think of other ways to accomplish the objective. The question is the easiest way to do this?
Update
Thanks! Sometimes these simple things are hard. /Marshallmy @valid_dates = #timegm( $sec, $min, $hour, $mday, $mon, $year ) ([timegm (0,0,16,4,10, 2014), timegm (0,0,22,5,10,2014)], #2014 [timegm (0,0,16,5,10, 2013), timegm (0,0,22,6,10,2013)], #2013 [timegm (0,0,16,6,10, 2012), timegm (0,0,22,7,10,2012)],)#2012 ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: generating an array of array
by GrandFather (Saint) on Sep 16, 2014 at 04:18 UTC | |
by Marshall (Canon) on Sep 16, 2014 at 05:26 UTC | |
|
Re: generating an array of array
by Cristoforo (Curate) on Sep 16, 2014 at 03:47 UTC | |
|
Re: generating an array of array
by AnomalousMonk (Archbishop) on Sep 16, 2014 at 07:49 UTC |