in reply to Re^2: Am I evil for doing this?
in thread Am I evil for doing this?
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?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Am I evil for doing this?
by jdporter (Paladin) on Mar 11, 2005 at 02:16 UTC | |
by ihb (Deacon) on Mar 11, 2005 at 12:39 UTC | |
by jdporter (Paladin) on Mar 11, 2005 at 14:24 UTC | |
|
Re^4: Am I evil for doing this?
by ihb (Deacon) on Mar 11, 2005 at 12:34 UTC | |
|
Re^4: Am I evil for doing this?
by Anonymous Monk on Mar 11, 2005 at 09:44 UTC | |
by Mugatu (Monk) on Mar 11, 2005 at 17:06 UTC |