in reply to Re: how to import a module var
in thread how to import a module var
This is especially important when cross language programs come along. When Perl is tied to Java or Python, those other languages can't see the exports, they need methods to call.
Perhaps the only valid use of exports in the OO context is for mixin modules which provide exported subs that lots of other classes can import into their packages. But those exporting mixin providers don't have constructors. Which leaves me back at my rule of thumb: constructors and Exporter don't mix.
This is not to say that clever OO modules might not have a magical import that does all sorts of mischief (like fabricating whole classes). But they shouldn't actually put anything into the caller's name space like Exporter does.
Phil
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: how to import a module var
by Perl Mouse (Chaplain) on Nov 22, 2005 at 14:36 UTC |