in reply to passing an array without a name to pop()
Your list of numbers is a list; the problem is that pop is the source of the surrounding context and provides a scalar one. If you check the prototype, pop is ";+" and + is a bit weird. Thus quoth perlsub:
The "+" prototype is a special alternative to "$" that will act li +ke "\[@%]" when given a literal array or hash variable, but will othe +rwise force scalar context on the argument. This is useful for functions + which should accept either a literal array or an array reference as the argument:
Update: Tweaked formatting.
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: passing an array without a name to pop()
by haukex (Archbishop) on Dec 03, 2019 at 20:51 UTC | |
by Fletch (Bishop) on Dec 03, 2019 at 21:26 UTC |