Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

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.

...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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://219861]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (7)
As of 2018-02-24 22:47 GMT
Find Nodes?
    Voting Booth?
    When it is dark outside I am happiest to see ...

    Results (311 votes). Check out past polls.