On Fri, Jul 14, 2006 at 09:33:14AM -0400, Bill Ricker wrote:
> > > Specifically, can the *.pmc file be in a different directory than
> > > the *.pm file that was intended to be used?
>
> If it were implemented exactly as Audrey said, it would -- if checking
> for $Module.pmc first, then for $Module.pm , which doubles the number
> of fstats to (upto) 2*scalar @INC. Possibly to avoid this security
> issue, possibly to buy back the overhead, it appears to have been
> implemented in a more efficient fashion :
>
> > A quick test seems to say no:
>
> That's hopeful. That implies it fstats PMC only after finding a PM but
> before reading the PM, and reduces the suggested 2xfstat overhead
> greatly. This could be verified with strace/truss.
And strace shows it does chech for a .pmc in every member of @INC:
...
stat64("/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/5.8.5/i386-linux-thread-multi/Data/Dumper.pmc",
0xbff9c830) = -1 ENOENT (No such file or directory)
open("/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/5.8.5/i386-linux-thread-multi/Data/Dumper.pm",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/5.8.5/Data/Dumper.pmc",
0xbff9c830) = -1 ENOENT (No such file or directory)
open("/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/5.8.5/Data/Dumper.pm",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
stat64("/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/i386-linux-thread-multi/Data/Dumper.pmc",
0xbff9c830) = -1 ENOENT (No such file or directory)
open("/usr/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/i386-linux-thread-multi/Data/Dumper.pm",
O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
--
Dan Boger
[EMAIL PROTECTED]
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm