B
Bigus
Hello
I would just like some clarification on "use"ing modules. Say we have the
following files on our system:
script1.cgi
module1.pm [contains sub - mod1function1()]
module2.pm [contains subs - mod2function1() and mod2function2()]
sciprt1.cgi has "use module1;" in it because it needs to call
mod1function1().
However, mod1function1() needs to call mod2function1(), so "use module2;" is
placed inside mod1function1().
At a later date script1.cgi needs to use mod2function2(). in addition to
mod1function1(), so "use module2;" is placed directly into script1.cgi.
So we now have a scenario where script1.cgi is loading both modules but when
mod1function1() is called it loads module1.pm again (or does it?)
That is a simple case but in reality our system has a dozen modules and
scores of scripts so it can be difficult keeping track of what modules are
loaded at any one time.
Is there a "best practise" in this kind of situation, when it comes to
loading modules?
Regards
Bigus
I would just like some clarification on "use"ing modules. Say we have the
following files on our system:
script1.cgi
module1.pm [contains sub - mod1function1()]
module2.pm [contains subs - mod2function1() and mod2function2()]
sciprt1.cgi has "use module1;" in it because it needs to call
mod1function1().
However, mod1function1() needs to call mod2function1(), so "use module2;" is
placed inside mod1function1().
At a later date script1.cgi needs to use mod2function2(). in addition to
mod1function1(), so "use module2;" is placed directly into script1.cgi.
So we now have a scenario where script1.cgi is loading both modules but when
mod1function1() is called it loads module1.pm again (or does it?)
That is a simple case but in reality our system has a dozen modules and
scores of scripts so it can be difficult keeping track of what modules are
loaded at any one time.
Is there a "best practise" in this kind of situation, when it comes to
loading modules?
Regards
Bigus