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 ( #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.


Comment on Re: Coding perl a plugin system?
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
Node Status?
node history
Node Type: note [id://219861]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (11)
As of 2014-10-01 18:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    What is your favourite meta-syntactic variable name?














    Results (31 votes), past polls