skazat has asked for the wisdom of the Perl Monks concerning the following question:
I have a hefty cgi script, its about 125k, with about 5 modules attached to it, so load time is becoming somewhat an issue. the thing is, i don't always need some modules, would this work?
sub some_function { use THIS_MODULE; # yadda yadda } sub another_function { use THIS_MODULE; use ANOTHER_MODULE; #yadda yadda }
in other words, would it work to only call modules using `use` when i need them in a specific function? or would that not work. and would it really help load time, or would all the modules get loaded anyhoo at load time?
-justin simoni
!skazat!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: loading a module only if you need it
by merlyn (Sage) on Oct 09, 2000 at 20:36 UTC | |
by tilly (Archbishop) on Oct 09, 2000 at 20:40 UTC | |
|
RE: loading a module only if you need it
by extremely (Priest) on Oct 10, 2000 at 01:26 UTC | |
by merlyn (Sage) on Oct 10, 2000 at 01:35 UTC | |
by extremely (Priest) on Oct 10, 2000 at 01:40 UTC | |
|
Re: loading a module only if you need it
by skazat (Chaplain) on Oct 09, 2000 at 21:42 UTC | |
by clemburg (Curate) on Oct 09, 2000 at 23:43 UTC |