operator uses this hash to determine whether a particular file has
already been included.
-If the file was loaded via a hook (see L<perlfunc/require> for a
-description of these hooks), a fake filename is inserted into %INC. It
-looks like F</loader/0x81095c8/Foo.pm>, where the hexadecimal number
-corresponds to the reference that was put in @INC.
+If the file was loaded via a hook (e.g. a subroutine reference, see
+L<perlfunc/require> for a description of these hooks), this hook is
+inserted into %INC in place of a filename.
=item %ENV
GV *filter_child_proc = 0;
SV *filter_state = 0;
SV *filter_sub = 0;
+ SV *hook_sv = 0;
sv = POPs;
if (SvNIOKp(sv)) {
LEAVE;
if (tryrsfp) {
+ hook_sv = dirsv;
break;
}
/* Assume success here to prevent recursive requirement. */
(void)hv_store(GvHVn(PL_incgv), name, strlen(name),
- newSVpv(CopFILE(&PL_compiling), 0), 0 );
+ (hook_sv ? SvREFCNT_inc(hook_sv)
+ : newSVpv(CopFILE(&PL_compiling), 0)),
+ 0 );
ENTER;
SAVETMPS;