Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Coding perl a plugin system?

by Beatnik (Parson)
on Dec 14, 2002 at 13:45 UTC ( [id://219861]=note: print w/replies, xml ) Need Help??


in reply to Coding perl a plugin system?

I use plugin code in a few places and I got around the variable handling by passing certain variables thru the constructor, as a hash reference, array reference or similar. You can also just have an inherited method that sticks the vars in a complex data structure.

Greetz
Beatnik
...Perl is like sex: if you're doing it wrong, there's no fun to it.

Replies are listed 'Best First'.
Re: Coding perl a plugin system?
by skx (Parson) on Dec 15, 2002 at 16:10 UTC

     Thanks for that. I did actually consider doing this, but if my plugins are to have the freedom to do arbitary things then they should have the freedom to read (and possibly modify) all the main codes variables/behaviour.

     This made me think that I'd end up having to pass all the variables I could to the plugin - which seems like a lot of housekeeping.

     The alternative is to give access to stuff in the main scope to the plugins - which was the source of my early problems.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-16 07:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found