in reply to Exporter, import, and tags w/ double meanings.

You can use Exporter's default methods for that if you define tags in %EXPORT_TAGS, like so:

use vars qw( @EXPORT @EXPORT_OK %EXPORT_TAGS ); @EXPORT = (); @EXPORT_OK = qw( foo bar baz ); %EXPORT_TAGS = ( all => [qw( foo bar baz )], nobaz => [qw( foo bar )], nobar => [qw( foo baz )], nofoo => [qw( bar baz )], );

After Compline,
Zaxo

Replies are listed 'Best First'.
Re: Re: Exporter, import, and tags w/ double meanings.
by hossman (Prior) on Sep 25, 2002 at 22:13 UTC
    That doesn't really solve his problem, err_raise and err_ignore aren't symbols he wants to export, or even sets of symbols he wants to export ... they are just flags, and if his client speciies those flags when importing his Module, he was arbitrary methods called.

    To answer that question, yes .. i believe writting your own import method which checks @_ for these special flags, takes the appropriate action, removes them from @_ and then delegates to export_to_level is the way to go.

    (Just don't forget that export_to_level expects you to leave "$self" in "@cleanargs" .. check the docs