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

it obviously has something to do with $hasarg

No, it has to do with @DB::args.

I'm not sure why Carp think it's being overridden incompletely

It seems to indicate @DB::args needs to be adjusted somehow to compensate for the fact that caller isn't being called from where the user thinks it is being called.

[Update: The check was introduced by this commit. Read the commit message for some info. ]

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:

That's because code was added to 5.14 to identify where the bad code is located ($where).

Replies are listed 'Best First'.
Re^2: Trying to understand (caller($i))[4], a.k.a. $hasargs [diagnostic]
by Oberon (Monk) on Feb 14, 2012 at 08:07 UTC
    Read the commit message for some info.

    Okay, read that, and it helped, but I can't say that I understood it all. DB is the debugger package, right? So I guess CORE::caller is setting up ... something ... that helps the debugger do ... something ... and folks who override CORE::GLOBAL::caller have to do the same thing or chaos will ensue? Am I getting that right? :-)

    That's because code was added to 5.14 to identify where the bad code is located ($where).

    Yeah, I saw that, but, in my case, $where was blank anyway, so I didn't see any point in including that code in retrospect. ;->