However, (2,4,6) clearly isn't a scalar.
No, and it isn't an array either - it's a list. Note that lists like the one you showed behave differently in scalar contexts than arrays do (which return the number of elements), see the Comma Operator:
In scalar context it evaluates its left argument, throws that value away, then evaluates its right argument and returns that value. ... In list context, it's just the list argument separator, and inserts both its arguments into the list.
The @{...} is a dereference operator, so you need to give it a reference for it to operate on, such as [2,4,6] as Paladin showed. See perlreftut and perlref.
In reply to Re: passing an array without a name to pop()
by haukex
in thread passing an array without a name to pop()
by TieUpYourCamel
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |