How should I pass settings to a module in Perl that also exports symbols? In Test::Version I want to add configuration settings that allow one to toggle certain features. I'm thinking about passing an anonymous hash to a custom import like so.

use Test::Version 1.2 qw( version_ok ), { is_strict =&gt; '1', has_version =&gt; '0' };


other options I've thought of include package variables (though more ugly in my opinion).

use Test::Version 1.2 qw( version_ok );
$Test::Version::IS_STRICT   = 1;
$Test::Version::HAS_VERSION = 0;


or maybe using some other kind of operator to denote config settings on import, though I'm not sure exactly how to implement this.

use Test::Version 1.2 qw( version_ok ), +is_strict =&gt; '1', +has_version =&gt; '0';


Keep in mind that this has a simple functional interface, so passing objects, or using config files is overkill. Any preferences? or other suggestions?
I would stay away from changing the normal workings of import(). I've never seen a module mix exporting and configuration at the same time (maybe you have, though), so leave those out (options 1 and 3). I think you are right in thinking that option 2 isn't too pretty. That leaves us with none of those options.

I think instead of this you should just allow calling version_ok and version_all_ok with the options hash.

version_ok({ is_string =&gt; 1, has_version =&gt; 0 });


Clear and standard, nothing odd going on.  From the way it seems like the module is going to be used this isn't a burden on the user (since there will normally only be one call to this in the entire test suite).