http://qs321.pair.com?node_id=57813

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

I'd like to pass parameters to a module during importation, such as:

  use MyModule { foo => 1, bar => 'two' };

No such facility exists in Exporter, so before I write my own import function, is there a module or code which already does this?

I need to pass options to the module that are accessible from the BEGIN block. It makes coding much easier than to have settings subroutines which destroy objects created by BEGIN and then recreate them. But that seems my only other alternative.

(On my list of things to do I may look into adding this as a patch to Exporter... it would be really useful.)