in reply to Re^3: Scalar Vs. List context
in thread Scalar Vs. List context

$ perl -le'print prototype "CORE::pop"' ;\@

A reference is a scalar and pop's first argument is a scalar reference to an array.

Replies are listed 'Best First'.
Re^5: Scalar Vs. List context
by LanX (Saint) on Jul 12, 2009 at 13:16 UTC
    exactly, but that's different from "evaluating in scalar context".

    like in $foo=\@bar, $foo is not the length of @bar!

    IIRC in Perl 6 there is less confusion, since the scalar of an array is the array-reference.

    Cheers Rolf

Re^5: Scalar Vs. List context
by ikegami (Patriarch) on Jul 13, 2009 at 17:21 UTC
    I never said it didn't result in a scalar. I said it wasn't evaluated in scalar context.
    $ perl -MO=Concise -e'pop @a' 6 <@> leave[1 ref] vKP/REFC ->(end) 1 <0> enter ->2 2 <;> nextstate(main 1 -e:1) v ->3 5 <1> pop vK/1 ->6 4 <1> rv2av[t2] lKRM/1 ->5 <-- "l"ist context. 3 <#> gv[*a] s ->4 -e syntax OK

    I also said it's silly to consider the context of something subjected to the \@ prototype.