in reply to Trying to understand (caller($i))[4], a.k.a. $hasargs

It indicates a lack of &f.

>perl -E"sub g { say +(caller 0)[4]?'':'no ', 'new @_; ', 0+@_, ' args +: ', @_ } sub f { g(@_) } f('abc');" new @_; 1 args: abc >perl -E"sub g { say +(caller 0)[4]?'':'no ', 'new @_; ', 0+@_, ' args +: ', @_ } sub f { &g } f('abc');" no new @_; 1 args: abc

Replies are listed 'Best First'.
Re^2: Trying to understand (caller($i))[4], a.k.a. $hasargs
by Oberon (Monk) on Feb 13, 2012 at 16:58 UTC
    It indicates a lack of &f.

    Excellent. That makes sense now; thanks for the concise explanation.

    Now, what about the Carp code? The OP code is drawn from 5.14.2, but I have the same issues in 5.12.4, and the Carp code is a bit simpler there: