$ perl -we "print (localtime(time))[2]"
print (...) interpreted as function at -e line 1.
syntax error at -e line 1, near ")["
Execution of -e aborted due to compilation errors.
####
$ perl -Mdiagnostics -we "print (localtime(time))[2]"
print (...) interpreted as function at -e line 1 (#1)
(W syntax) You've run afoul of the rule that says that any list operator
followed by parentheses turns into a function, with all the list
operators arguments found inside the parentheses. See
perlop/Terms and List Operators (Leftward).
####
$ perl -e "print +(localtime(time))[2]"
16