put useful info in %INC for files loaded by a hook in @INC
Rafael Garcia-Suarez [Tue, 28 Aug 2001 14:23:43 +0000 (16:23 +0200)]
Message-ID: <20010828142343.A19299@rafael>

p4raw-id: //depot/perl@11771

pod/perlvar.pod
pp_ctl.c

index cdbd53f..d723271 100644 (file)
@@ -1080,6 +1080,11 @@ value is the location of the file found.  The C<require>
 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.
+
 =item %ENV
 
 =item $ENV{expr}
index f64b18d..6a23961 100644 (file)
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -3160,7 +3160,7 @@ trylocal: {
                    }
 
                    Perl_sv_setpvf(aTHX_ namesv, "/loader/0x%"UVxf"/%s",
-                                  PTR2UV(SvANY(loader)), name);
+                                  PTR2UV(SvRV(dirsv)), name);
                    tryname = SvPVX(namesv);
                    tryrsfp = 0;