I have a very interesting fix. I am working on a Perl script interface in a CVS repository and have created Perl objects for presentation Modules, Pathsand Files. Since Modules, Pathsand Filesmay have CVS commands issued to them, I set up a routine AUTOLOADto accept any unidentified methods and release them on the object, as if they were CVS commands.
All of these CVS commands are executed in exactly the same way, but some of them need special processing performed with the exit to get the desired result.
For example, I want to take the output from the diff command and reformat it before I return it.
I use Moose, so usually this special processing can be done as follows:
after 'diff' => sub {
}
The problem is that I never explicitly created a method diff, since it is generated AUTOLOAD, and Perl does not allow me to create a method modifier for it, because it does not technically exist!
Is there a way to make this work as I want?
source
share