[Perl] Using namesapces
Shlomo Yona
shlomo at siftology.com
Wed Sep 12 23:20:49 PDT 2001
Arie Abramovitch wrote:
>
> Hi
>
> I have the following need: I want to use two .pm modules from my main script, but without pre-pending the namespace::
>
> When there is only one such module, I can use the package clause to declare the namespace which I want for default use. But
> what if I have two or more such modules?
>
> Thanks,
> Arie Abramovitch
Hello.
Please provide a short example.
In case I got you right:
If you have in those two modules, variables or subroutines which share the same name - than you can't escape prefixing those
names with the modules' namespace.
Of course, of the code in those modules is "object oriented" (i.e. the modules are written as objects) - you can instanciate an
instance of each, with a different name - and from there on you should have no problem.
--
Shlomo Yona.
Software Engineer.
Siftology Ltd. Israel.
Shlomo.Yona at Siftology.com
More information about the Perl
mailing list