in reply to print list element from function syntax

What happens is that perl interprets this as
print(localtime) # call print with one argument: whatever is returne +d by localtime [2]."\n"
and then perl doesn't know what to do with the [2] after the print statement.

To fix this, simply write print +(localtime)[2]."\n";

-- Hofmator