On Sat, 2016-09-10 at 13:09 +0000, Pedro David Marco wrote: > Hi there... > i am not an expert OO developer so i am somehow flying blind in here > and need your help please > Basically i want to write my own plugin and i have some repeated > calculations in each and every plugin method that i would like to > reduce to just one, but i am not sure on how to do it... > My understanding is that i can do it inside the constructor (the "sub > new") and put the results in a data structure that can be accessed > later by any method inside the plugin. > ... or abstract it into a method. It will help a lot if you learn the basics of OO programming before tackling a plugin.
See "Programming Perl", aka the Camel book, chapter 12. Written by Larry Wall, Tom Christiansen and Jon Orwant, pub. O'Reilly. Martin