nysus has asked for the wisdom of the Perl Monks concerning the following question:
If I import Module A and Module B into my program, their variables are now accessible to the current package without having to name them (e.g. $ModuleA::x). But what happens if Module A and Module B both a variable or subroutine with the same name? Let's say there is a &ModuleA::function and a &ModuleB::function and I call function(); from my program. How will my program know which function() subroutine to call?
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot";
$nysus = $PM . $MCF;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Avoiding variable conflict when importing modules
by btrott (Parson) on Jun 25, 2001 at 02:40 UTC | |
|
(tye)Re: Avoiding variable conflict when importing modules
by tye (Sage) on Jun 25, 2001 at 07:25 UTC | |
|
Re: Avoiding variable conflict when importing modules
by chipmunk (Parson) on Jun 25, 2001 at 02:44 UTC | |
|
Re: Avoiding variable conflict when importing modules
by Zaxo (Archbishop) on Jun 25, 2001 at 02:45 UTC |