in reply to Re: Re: Possible Stupid Perl Trick - Importing method into object class?
in thread Possible Stupid Perl Trick - Importing method into object class?

While this will probably work, it ends up with the same problem from the original idea: you have to maintain a repository of new functions which may be overlooked.

You could skip the repository, and so something like

if ( -f "$attr.sub" ) { # load and eval "$attr.sub" goto &$attr; }
I used a registry so that you could stage the debugging of new functions. If that isn't an issue for you, then don't use a registry. I've used a registry for something like this in years past, and have found it useful, but YMMV.

  • Comment on Re: Re: Re: Possible Stupid Perl Trick - Importing method into object class?
  • Download Code