dreamy has asked for the wisdom of the Perl Monks concerning the following question:
Itis obvious, because use is loaded
in the BEGIN block, and require later, so my
benchmarking does not see it.
Now the question: is use faster ?
(meaning: compile-time AND run-time )
or are they both equal ?
p.s. i am using require to load some
modules on demand (using if-blocks),
that are needed only 10% of the times
the script runs, so it will not have to compile
everything everytime - but maybe i am not right in that ?
so there is a second little question:
is Foo.pl loaded and compiled here ?if (1 == 2) { require "Foo.pl"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: what's faster: use or require
by Mr. Muskrat (Canon) on Dec 07, 2002 at 18:13 UTC | |
|
Re: what's faster: use or require
by chromatic (Archbishop) on Dec 07, 2002 at 20:04 UTC | |
|
Re: what's faster: use or require
by pg (Canon) on Dec 07, 2002 at 18:47 UTC | |
|
Re: what's faster: use or require
by dws (Chancellor) on Dec 07, 2002 at 18:51 UTC | |
|
Re: what's faster: use or require
by Aristotle (Chancellor) on Dec 08, 2002 at 12:16 UTC | |
by cjf-II (Monk) on Dec 08, 2002 at 12:48 UTC | |
by dreamy (Sexton) on Dec 08, 2002 at 14:15 UTC |