in reply to "use" modifier code via import()
In the past (particularly with Perl 5.6) I've noticed that export_to_level does not work exactly like you would want. (It reports errors at the wrong level.) Therefore this alternate strategy may be more reliable.
I also notice that you are using prototypes in your definition of sub1. There was an excellent article on perl.com explaining prototypes in Perl and demonstrating why they are problematic. Unfortunately the link to it isn't working very well at the moment, so I can't direct you to read that article. But I can assure you that if your understanding of prototypes are shaped by prototypes in any other language, that Perl's version of the same is pretty definitely not what you want, and you're better off forgetting that you ever heard about them.
I also have to second perrin's comment. While playing around with export semantics can achieve all sorts of cool effects, unless it is really important for what your module does, it is better programming practice to stick to normal export semantics and not overload your export semantics.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: "use" modifier code via import()
by pbeckingham (Parson) on May 18, 2004 at 00:43 UTC | |
by tilly (Archbishop) on May 18, 2004 at 01:29 UTC |