The other syntax - the one perl is guessing wrong - is @{foo} being a form of the array @foo. Perl is not looking first for a builtin function there, but a bareword.
You can use parens as you did, or place a harmless operator in front of the shift.
which prints, ashiftyarrayAmereexamplemy @shift = qw/a shifty array/; sub foo { print @{shift}; my @vars = @{+shift}; print @{vars} } foo [qw/A mere example/]; __END__
After Compline,
Zaxo
In reply to Re: Ambiguity of @{ shift }
by Zaxo
in thread Ambiguity of @{ shift }
by PerlingTheUK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |