in reply to Ambiguity of @{ shift }
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
|
|---|