Actually, that seems slightly LESS evil to me
It's so much less evil, in fact, that it's actually allowed by strict. That should say a lot. Frankly, I think jdporter's method isn't evil at all. If you wanted to be extra careful, you could use UNIVERSAL::can to make sure the method exists before trying to call it:
use strict; my $method = "rewrite_$2"; if ($self->can($method)) { $self->$method($1); } else { warn "$self does not have $method"; }
Update: ihb++, I agree fully with Re^5: Am I evil for doing this?
In reply to Re^3: Am I evil for doing this?
by Mugatu
in thread Am I evil for doing this?
by Whitehawke
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |