Syntactic Confectionery Delight | |
PerlMonks |
Re^2: Old Code reference wants new life as Object.by Devanchya (Beadle) |
on Dec 08, 2006 at 19:04 UTC ( [id://588672]=note: print w/replies, xml ) | Need Help?? |
Thanks for the responces...
I am trying to maintain the depatch table at this time, as it is integrated into the main program preety heavly. If there is a better way to do it with out loosing the dynamic option, then that most likely would work. I considered using inheritance etc but it didn't work right for the option.
Right now each of the existing plugin's have a load section which loads a code reference into a global dispatch hash: $dispatch->{$dothis_now}->() # does the code ref. Now as you can tell, doing a code ref with \&login for example will work. It will not run the code when loaded into the hash, and waits nicely until it is wanted. $dispatch{self_test} = $self->login; Will execute the code before it is placed in the hash. I have not yet tested the other options given, but will as soon as I'm next to my development machine. But hopefully this clears it up a bit. It may be both the calling and the plugin code need to be 'fixed' to work properly. --
Even smart people are dumb in most things...
In Section
Seekers of Perl Wisdom
|
|