in reply to print list element from function syntax

Yup, see gory details of parsing quoted constructs. try perlsyn
To perl, it looks like you maybe want to print( something ) but it can't decide
C:\>perl -MO=Deparse,-p print (localtime)[2]."\n" __END__ syntax error at - line 1, near ")[" - had compilation errors. ; C:\>perl -MO=Deparse,-p print "".(localtime)[2]."\n" __END__ print((('' . (localtime)[2]) . "\n")); - syntax OK
update: I stuck some stuff out (doesn't apply). Try print ( (localtime)[2], "\n" ). Then edited some (i really rushed on this one).

MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
** The third rule of perl club is a statement of fact: pod is sexy.