What is the difference between library files and modules in Perl?
It's all Perl code to perl
. All distinctions are purely idiomatic.
Perl code meant for inclusion that uses a package
directive:
.pm
. Must have this extension for use
to find them.require
, possibly via use
.
Perl code meant for inclusion that doesn't use a package
directive:
.pl
.do
.Perl code meant for direct execution by interpreter:
.pl
, or none at all.#!
) line so they can be started without specifying perl
.Library files (I'm assuming you mean require 'foo.pl'
stuff here) are an obsolete (pre-Perl 5) form of external module. For the most part, you shouldn't need to care any more, although there are still some Perl 4 installations around and therefore still some Perl code that remains backward compatible with them (and there's some code that's simply never been updated and still loads getcwd.pl
etc.).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With