Try
print +(localtime)[4]; #or print( (localtime)[4] );
To discover why this works, enable warnings:) and then read this extract from perlfunc:print
Also be careful not to follow the print keyword with a left parenthesis unless you want the corresponding right parenthesis to terminate the arguments to the print--interpose a + or put parentheses around all the arguments.
In reply to Re: (localtime)[3] vs. ((localtime)[3])
by BrowserUk
in thread (localtime)[3] vs. ((localtime)[3])
by Taulmarill
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |