Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

If I'm happy to fully-qualify function names in my scripts, is there any harm in simply not using Exporter at all in my modules? For example, in my Frob.pm:

package Frob; use strict; use warnings; sub frobber { ... } 1;

Is there any functionality I'm missing out on, aside from not getting to use the unadorned symbol names in my script?

Replies are listed 'Best First'.
Re: Any harm in not using Exporter at all in my procedural modules?
by ikegami (Patriarch) on Feb 23, 2010 at 16:38 UTC
    It'll prevent version checks of the form
    use Foo '1.002';
    but that's probably it. Note that the following form will work without Exporter:
    use Foo 1.002;

      Oh, that's very cool. If I put our $VERSION = 1.002; near the top of my module, and if I stick with floats everywhere for version numbers, then things work as expected.

      OTOH, if I use strings ('1.002' instead of 1.002), then things fail silently. Good to know.

      Thanks!

Re: Any harm in not using Exporter at all in my procedural modules?
by jethro (Monsignor) on Feb 23, 2010 at 16:07 UTC
    No, not that I know of.

    Modules that use an OO interface also don't use Exporter because they get the service of Exporter through the object interface.