-----Original Message----- >From: oryann9 <[EMAIL PROTECTED]> >Sent: Aug 8, 2007 11:26 AM >To: beginners@perl.org >Subject: Re: Timelocal's input parameters > > > >> #!/usr/bin/perl >> use strict; >> use warnings; >> use Time::Local; >> >> my %month; >> @month{ qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct >> Nov Dec/ } = 0..11; >> >> my $date = "Thu Mar 9 23:04:03 2006"; >> >> my (undef, $month, $day, $h, $m, $s, $year) = split >> /\W+/, $date; >> >> my $time = >> timelocal($s,$m,$h,$day,$month{$month},$year); >> >> print $time,$/; >> >> print scalar localtime $time; >> >> >> (Prints) >> 1141963443 >> Thu Mar 9 23:04:03 2006 > >Jeff, > >Is this an array of hashes desingnated by { }? > >my %month; >@month{ qw/Jan Feb Mar Apr May Jun Jul Aug Sep Oct >Nov Dec/ } = 0..11; >
Hello, It's called as hash slice.Please see 'perldoc perldata' and search for keyword 'slice'. -- Jeff Pang <[EMAIL PROTECTED]> http://home.arcor.de/jeffpang/ -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/