in reply to Re: Calling sub's: return true
in thread Calling sub's: return true

Yes, but exporter "pollutes" the original scripts namespace, and you can end up, especially if you use the same set of subs for multiple scripts, getting incredibly confused as to where the sub is if you need to modify or otherwise examine it. Merely using require allows you to be precise as to which sub you want and where it is.

Replies are listed 'Best First'.
Re: Re: Re: Calling sub's: return true
by runrig (Abbot) on Jan 11, 2003 at 02:31 UTC
    Using EXPORT_OK with Exporter lets you not only control which subroutines 'pollute' the caller's namespace, it is also self-documenting which subroutines get imported and where they come from when you say:
    use MyFunctions qw(function1 function2 etc);
    Any subs you don't want imported due to namespace collisions you can still call with MyFunctions::function(...)