From: Casey West Date: Fri, 9 May 2003 17:03:50 +0000 (-0400) Subject: Document that perl tries to load .pmc files before .pm files. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=662cc546c7bf483f71f7e4bf7b981df15c7d932d;p=p5sagit%2Fp5-mst-13.2.git Document that perl tries to load .pmc files before .pm files. Subject: Re: [perl #8860] [not RESOLVED] .pmc extension not documented in require Message-ID: <20030509210350.GW49820@geeknest.com> p4raw-id: //depot/perl@19466 --- diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 44a6f28..2a3533b 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -4058,6 +4058,15 @@ 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 it's 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. + 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 references, array references and blessed objects.