#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 ;
In reply to generating an array of array by Marshall
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |