A co-worker was trying to take some of the elements from gmtime's return
value. He did something like the following:

$ perl -E'$,="\t";say gmtime[1..5]'
8       32      12      31      7       2999416 1       243     0

I suggested he try something like this instead...

$ perl -E'$,="\t";say ((gmtime)[1..5])' 
36      18      4       6       119

... and that was what he wanted, but it didn't matter because he
re-rewrote his code to use strftime, which we both thought was more
readable.  But still, what are those numbers in the first example?
Neither of us can figure where they come from. The parens must be a
clue, but all I could think was gmtime was interpreted as an array
reference, but thinking that didn't get me anywhere that made sense to
me.

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to