Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Auto-use all modules in location?

by Anonymous Monk
on Dec 12, 2003 at 11:23 UTC ( [id://314275]=note: print w/replies, xml ) Need Help??


in reply to Re: Being helpful to a fault?
in thread Being helpful to a fault?

Auto loading modules for a plugin system would be pretty valid.

I must beg to differ. Or at least, I can't think of a reason :-).

  • Listing modules in a location, for a user to choose from, would be pretty valid. I suppose.
    But what if a plugin didn't appear as MyCompany::Plugins::PluginName? What if it was ThirdParty::CompanyPlugins::PluginName?
  • Auto-loading modules when required would be pretty valid.
    But that's just

    eval "use $module()" or die "Could not load plugin $module, error: $!";

  • Auto-loading modules listed in a config file would be pretty valid.
    Or just require() a file which use-s the ones you want. (Hey, perl has a syntax, why invent another?)

But why would you want to auto-load modules in a location? If you want to temporarily stop using the module, you'd have to uninstall it.

Replies are listed 'Best First'.
Re: Auto-use all modules in location?
by rchiav (Deacon) on Dec 12, 2003 at 13:45 UTC
    You have a perl app named someapp.pl. With the app is a spec on how to create plugins for the app. The plugins go into /etc/someapp/. Sharpdevelop does this very thing (but it's not Perl). There's a spec on how to create a plugin and it will load all plugins in the plugin path.

    I'm not saying that the person who asked the question was even intending this, but how is it your or my place to tell someone their wrong without even knowing what they're doing? If something seems suspicious, tell them you're curious as to why. But again, just because you can't see a valid reason doesn't mean that there isn't a valid reason.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-26 06:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found