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
    If you check the prototype, pop is ";+"

    No, not anymore, this was an experiment added in Perl 5.14 and removed in 5.24; see "Array and hash container functions accept references" (aka "autoderef") in perlexperiment. Its prototype has gone back to ;\@, like it was in 5.12 and below. The removal of the feature is why the "Experimental pop on scalar is now forbidden" error happens in the first place.

      Derp! That's what I get for trying it on my older desktop install instead of a close-to-current version.

      The cake is a lie.
      The cake is a lie.
      The cake is a lie.