There is a hack that allows an ‘our’ variable to be found in the pad
in the statement in which it is declared, to avoid a warning (since
the fallback would be to look up the very same variable in the current
package anyway).
Since the warning this hack avoids doesn’t apply to subroutines, we
can just skip it for subroutine lookup.
if ((PADOFFSET)offset != NOT_IN_PAD)
return offset;
+ /* Skip the ‘our’ hack for subroutines, as the warning does not apply.
+ */
+ if (*namepv == '&') return NOT_IN_PAD;
+
/* look for an our that's being introduced; this allows
* our $foo = 0 unless defined $foo;
* to not give a warning. (Yes, this is a hack) */