$ dateHuh?
Wed Aug 13 14:34:53 EDT 2014
$ re.pl
$ # The join() is only for cosmetic reasons
$ join " " => localtime
6 36 14 13 7 114 3 224 1
$ # Let's grab only the HH:MM part (items 2 and 1)
$ my ($h, $m) = localtime[2,1]
$VAR1 = 56;
$VAR2 = 44;
Oh, I see: I forgot my parentheses.
$ ($h, $m) = (localtime)[2,1]Much better. But where the hell did the first set of values come from?
$VAR1 = 14;
$VAR2 = 41;
$ join " " => localtime[2,1]Dang, I forgot that localtime() can take an argument, a Unix time number (just like localtime(3) takes a time_t as argument). This is all starting to make sense.
56 31 8 17 10 75 1 320 0
$ scalar localtime[2,1]
Mon Mar 10 02:35:04 1975
$ [2,1] . ''(I'm still a bit surprised that Perl didn't say a word about this.)
ARRAY(0x9f9dd0c)
$ [2,1] + 0
164751992
$ scalar localtime 164751992
Sat Mar 22 15:26:32 1975
No comments:
Post a Comment