Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Altering Package Subs and Running In To Problems

by Aighearach (Initiate)
on Nov 11, 2004 at 11:47 UTC ( [id://407000]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Altering Package Subs and Running In To Problems
in thread Altering Package Subs and Running In To Problems

Ahhhh, this code explains it. You're not wanting to step on toes, you're wanting your users to step on YOUR toes!

Another thing to consider, is using the Safe module (with everything turned on perhaps) to load the plugins into a certain namespace. And then use that namespace for the parts of your code you want the plugins to overwrite. That way, you can even still publish an interface, but each plugin can only see the plugin-accessible part of the namespace.

use Safe; my $cpt = Safe->new( 'PluginNamespace' ); $cpt->deny_only(); $cpt->rdo( PLUGINFILENAME );
And then the plugin doesn't have to mess with PluginNamespace, that happens automatically. You can even pass things in (which is as if the plugin got them from you with export. Like a reverse export) and other crazy stuff.

I use Safe alot, but rarely for what it was intended for...


--
Snazzy tagline here

Replies are listed 'Best First'.
Re^4: Altering Package Subs and Running In To Problems
by Bovine (Initiate) on Nov 11, 2004 at 23:50 UTC

    Hmm, sounds like it might work. I'll look into that.
    Thanks.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-04-20 02:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found