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.