in reply to Re^2: shift on empty array in list context broken
in thread shift on empty array in list context broken

On the other hand, try

my @x = (); my $x = splice @x, 0, 1;

What splice says is true in scalar context.

Replies are listed 'Best First'.
Re^4: shift on empty array in list context broken
by LanX (Saint) on Jul 13, 2019 at 22:21 UTC
    what do you mean?

    DB<17> ($x= splice @x, 0, 1 ) and print "true" DB<18> p !! splice @x, 0, 1 DB<19>

    it's false for me.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

      I believe that, by "What splice says is true in scalar context.", Tybalt meant "in scalar context, the documentation for splice holds true", not "in scalar context, splice returns a truthy value".