suaveant has asked for the wisdom of the Perl Monks concerning the following question:
The .pl files we were requiring are all in the main:: scope, and there are function names that collide, creating havoc. I would like to force each .pl into it's own namespace, and am not sure how (short of making a wrapper .pl file that declares a package).
was suggested, but doesn't work right, since inside the require perl drops back to the container package, main::package foo; require './foo.pl'; package main;
I think I can fix this by making an object oriented interface, but does anyone know a way to do it with the requires? Whitout making a stub file for each?
- Ant
- Some of my best work - Fish Dinner
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Wrapping requires in a package...
by stefp (Vicar) on Sep 07, 2001 at 22:44 UTC | |
by tye (Sage) on Sep 08, 2001 at 00:42 UTC | |
|
Re: Wrapping requires in a package...
by perrin (Chancellor) on Sep 08, 2001 at 00:50 UTC | |
by tye (Sage) on Sep 08, 2001 at 01:28 UTC | |
by perrin (Chancellor) on Sep 08, 2001 at 09:01 UTC | |
by tye (Sage) on Sep 08, 2001 at 09:37 UTC |