[oak perl] ?? Include.H in PERL??
Mark Bole
mark at bincomputing.com
Mon Jul 25 18:15:16 PDT 2005
> Stephen Kolupaev wrote:
> [...]
>
> use Xxx;
>
>means go find the file Xxx.pm and load it (i.e. execute it) before executing any
>statements in your main program.
>
>
"use" has a little more baggage than that, it also tries to import into
your namespace. Which is why "require" is the closest to the C
pre-processor directive "#include" (the original question).
I agree that if you are creating modules, "use" is the way to go. I
also agree that the use of separate Main.pm, File.pm, Data.pm, etc.
modules is not something I've ever seen, or had to do myself.
The docs say you can also do:
use Xxx ();
to avoid the importing behavior, more like the "BEGIN {require ...;}"
syntax.
--
Mark Bole
http://www.bincomputing.com
925-287-0366
>
>
[...]
More information about the Oakland
mailing list