Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: Re (tilly) 3: Passing parameters to a module's import function

by rrwo (Friar)
on Feb 13, 2001 at 20:50 UTC ( [id://58150]=note: print w/replies, xml ) Need Help??


in reply to Re (tilly) 3: Passing parameters to a module's import function
in thread Passing parameters to a module's import function

Your point about multiple modules using it is a good one. However, this module is not likely to be used by anything other than a main program (it's a version of Win32::EventLog::Carp which traps warnings and fatals and posts them in the Windows NT event log; I'd like to give the option of specifying a different source name, so that related scripts can show up in the logs using one name than each individual script's file name.)

I'm experimenting with various ways to handling this. By specifying these options upon importing, compilation errors and warnings will be logged under the parameters specified--as "FooProject" rather than "index.pl" and logged in the System log rather than Application log, for instance.

This is a very specialized case, so it probably would make more sense in a separate module which extends Exporter rather than Exporter. But there are cases where one may want to pass some configuration information to the module.

As for specifying types, that feature isn't important to me. Sometimes people want it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://58150]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (8)
As of 2024-03-28 15:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found