It doesn't work because it's wrong. $val = ( func() ) [ 0 ] would give you the first element of the list returned. And read perldoc perlsub about the differences between func();, &func();, and &func;.
In reply to Re: index into list returned by subroutine
by Fletch
in thread index into list returned by subroutine
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |