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

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:

sub caller_info { my $i = shift(@_) + 1; my %call_info; { package DB; @args = \$i; # A sentinal, which no-one else has the address of @call_info{ qw(pack file line sub has_args wantarray evaltext is_require) } = defined &{"CORE::GLOBAL::caller"} ? &{"CORE::GLOBAL::caller"}($i +) : caller($i); } unless (defined $call_info{pack}) { return (); } my $sub_name = Carp::get_subname(\%call_info); if ($call_info{has_args}) { my @args; if (@DB::args == 1 && ref $DB::args[0] eq ref \$i && $DB::args[0] +== \$i) { @DB::args = (); # Don't let anyone see the address of $i @args = "** Incomplete caller override detected; \@DB::args were + not set **"; } else { @args = map {Carp::format_arg($_)} @DB::args; } if ($MaxArgNums and @args > $MaxArgNums) { # More than we want to +show? $#args = $MaxArgNums; push @args, '...'; } # Push the args onto the subroutine $sub_name .= '(' . join (', ', @args) . ')'; } $call_info{sub_name} = $sub_name; return wantarray() ? %call_info : \%call_info; }

Again, I can almost see what's going on here, but not quite. It looks like the if ($call_info{has_args}) is only there to keep from checking args when there really weren't any, so perhaps it's not as big a piece of the puzzle as I had suspected. The main question is, what exactly is supposed to be triggering that "incomplete override" message?