That's reasonable. I would change the code to call the subroutine as Our::Redirects->$func (the subroutines would have to be changed to something like sub www_theirsite_com { my ($class, $url) = @_; . . . }. Also, I would pass the URI object instead of its string form. Lastly, wrap the call in an eval to get rid of the conditional (such as eval { Our::Redirects->$func($uri) };).
----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer
: () { :|:& };:
Note: All code is untested, unless otherwise stated
In reply to Re: Re: Re: Organising lots of simple regexes
by hardburn
in thread Organising lots of simple regexes
by ViceRaid
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |