in reply to Re^2: array element return syntax
in thread array element return syntax
The only "weird" part might be why there are extra parens on the print. I.e., why not
And the answer is precedence. To perl, that looks like a function call (to the print function) with a parameter of localtime(time). So it's reallyprint (localtime(time))[2];
Which doesn't make any sense, so perl tells you so.print(...)[2];
|
|---|