Perl Programming/Keywords/require

The require keyword
The require keyword demands a Perl VERSION, some semantics specified by EXPRESSION or which is in $_, if EXPRESSION is missing. VERSION may be either a numeric argument like as 5.006 that will be compared to <tt>$]</tt>, or a literal of the form <tt>v5.6.1</tt> that will be compared to <tt>$^V</tt> (= <tt>$PERL_VERSION</tt>). The literal form should be avoided, as it leads to misleading error messages in early Perl versions. If <tt>VERSION</tt> is larger than the version of the Perl interpreter, an exception is raised.

Without these parameters, <tt>require</tt> demands a file to be included, if it has not already been included before. The file will not be included twice under the same specified name. The included file must return true at the end, so, it is custom to end such files with a <tt>1</tt>.

If the <tt>EXPRESSION</tt> is a bareword, <tt>require</tt> assumes a <tt>.pm</tt> extension, replacing all <tt>::</tt> with <tt>/</tt> in the filename so that standard modules load easily.

Before searching for a file with the <tt>.pm</tt> extension, <tt>require</tt> searches first for a file with <tt>.pmc</tt> extension, loading it instead of the <tt>.pm</tt> file, if found.