In the following code snippet, I don't understand why Perl 5.8.8 says there is a syntax error near ")[" at #3.
#!/usr/bin/perl use strict; use warnings; my $t = (time)[0]; #1 my @t = localtime $t; @t = localtime ((time)[0]); #2 @t = localtime (time)[0]; #3
If I comment out #3, both #1 & #2 correctly populate @t. It just seems as though the outer parentheses in #2 should not be needed.
Thanks,
eye
In reply to Parenthetical help by eye
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |