Thanks everyone for the help, this is exactly what I needed.

On 7/20/06, Tom Phoenix <[EMAIL PROTECTED]> wrote:

On 7/20/06, Shane Calimlim <[EMAIL PROTECTED]> wrote:

> I'd like to add some sub routines to the global namespace.  I know this
is
> usually considered bad design for modules, but I intend to do this only
for
> a personal project.  I'd just like to know if this is possible, and how.

You can always make a normal module, 'use' it in the normal way, and
thereby put your subroutines into the global namespace, which is named
'main' in Perl. Is that what you mean? But it's generally called
"exporting", not "polluting", when you do it this way.

Alternatively, you could make a library file that never specifies
another package name, thus defining everything in package 'main' by
default.

> And if so, using pure perl code or would I have to delve into xs?

This shouldn't need anything but Perl. But do you ask this because
you're thinking about overloading core functions with your own? Since
it's simple to do what you seem to be asking, I'm unsure that I've
understood your request.

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

Reply via email to