From: Rafael Garcia-Suarez Date: Sun, 12 Mar 2006 15:12:29 +0000 (+0000) Subject: Load .pmc always, even if they are older than a matching .pm file. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=a91233bf4cf6a12df8935c3530a6ca900ca6ca2f;p=p5sagit%2Fp5-mst-13.2.git Load .pmc always, even if they are older than a matching .pm file. (This trick is going to be used by pugs.) p4raw-id: //depot/perl@27483 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 4184c8e..8b12f98 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4538,14 +4538,12 @@ will complain about not finding "F" there. In this case you can do: eval "require $class"; -Now that you understand how C looks for files in the case of -a bareword argument, there is a little extra functionality going on -behind the scenes. Before C looks for a "F<.pm>" extension, -it will first look for a filename with a "F<.pmc>" extension. A file -with this extension is assumed to be Perl bytecode generated by -L. If this file is found, and its modification -time is newer than a coinciding "F<.pm>" non-compiled file, it will be -loaded in place of that non-compiled file ending in a "F<.pm>" extension. +Now that you understand how C looks for files in the case of a +bareword argument, there is a little extra functionality going on behind +the scenes. Before C looks for a "F<.pm>" extension, it will +first look for a similar filename with a "F<.pmc>" extension. If this file +is found, it will be loaded in place of any file ending in a "F<.pm>" +extension. You can also insert hooks into the import facility, by putting directly Perl code into the @INC array. There are three forms of hooks: subroutine diff --git a/pp_ctl.c b/pp_ctl.c index 7ff4858..fcc6220 100644 --- a/pp_ctl.c +++ b/pp_ctl.c @@ -3037,15 +3037,7 @@ S_doopen_pm(pTHX_ const char *name, const char *mode) fp = check_type_and_open(name, mode); } else { - Stat_t pmstat; - if (PerlLIO_stat(name, &pmstat) < 0 || - pmstat.st_mtime < pmcstat.st_mtime) - { - fp = check_type_and_open(pmc, mode); - } - else { - fp = check_type_and_open(name, mode); - } + fp = check_type_and_open(pmc, mode); } SvREFCNT_dec(pmcsv); }