in reply to Storing Regular Expressions as Strings in Array??
You could try setting up a hash or list of closures with the appropriate regex in them:
Something like that might do the trick...my @subs; push @subs,sub{local $_=shift; s/foo/bar/g; $_}; push @subs,sub{local $_=shift; s/baz/zaz/g; $_}; my $string="foo baz"; $_->($string) foreach @subs; print $string;
Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Code Correction
by arunhorne (Pilgrim) on May 02, 2002 at 17:53 UTC | |
by demerphq (Chancellor) on May 03, 2002 at 08:26 UTC |