|We don't bite newbies here... much|
Why do multiple requires not work?by srinigs (Novice)
|on Dec 06, 2012 at 11:45 UTC||Need Help??|
srinigs has asked for the
wisdom of the Perl Monks concerning the following question:
Supposing i have a module Mod.pm which has a statement "require /a/b/script" and there is a script run.pl which has the statements "use Mod" and "require /a/b/script", then, when any routine inside /a/b/script is called from run.pl, I get the "Undefined routine ..." error. This error does not appear when the require statement is removed from Mod.pm module, but the vice versa is not true (ie when I remove the require statement from run.pl and retain the one in Mod.pm, the error still persists).
Can you please explain why multiple use statements are not a problem but multiple "require" statements cause an issue?