and then perl doesn't know what to do with the [2] after the print statement.print(localtime) # call print with one argument: whatever is returne +d by localtime [2]."\n"
To fix this, simply write print +(localtime)[2]."\n";
-- Hofmator
In reply to Re: print list element from function syntax
by Hofmator
in thread print list element from function syntax
by bsdz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |