2/ you code is basically:
sub { return 1 if m!foo!o; return 0 }
this can be simplified to
sub { m!foo!o }
Not only this returns a boolean value but at no extra cost the list of strings matched in parenthesis if there are like the rest of your post implies. In that later case, the boolean value is obtained indirectly because in scalar context, the list is converted to its length. This leads me to 3/
3/ now about $match = qq@ return (\$1,\$2) if m!(foo)(bar)!; @; As I said the match operator returns directly the list of matches so you don't need to return explicitely $1, $2...
I really don't understand what you want to do. But I am sure your way of doing it is certainly incorrect.
Edited: suppressed inaccurate remarks. Thanks to chipmunk for pointing out my mistakes.
-- stefp
In reply to Re: eval routines for faster regexp: how-to...
by stefp
in thread eval routines for faster regexp: how-to...
by gleeco
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |