This is because Perl sees something else, it associates the parentheses with print():
print(gmtime(time)) [6];
This makes no sense to Perl.
To fix this, you need one more set of parentheses:
print( (gmtime(time))[6] );
In reply to Re: printing element of anonymous array
by Corion
in thread printing element of anonymous array
by perltux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |