in reply to is this a regexp question ?

I'm not sure whether you can eval a function in a regex. If I understand your question correctly, you can just do
sub search_equivalent{ #do stuff here and return your equivalent pattern return $equivalent; } my $equiv = search_equivalent(); if ($thisstring =~ m/$equiv/){ .... }
There is no real need to put a function call in the regex.

Jorg

"Do or do not, there is no try" -- Yoda

Replies are listed 'Best First'.
(ar0n) Re (2): is this a regexp question ?
by ar0n (Priest) on Jun 04, 2001 at 05:14 UTC
    Even though this is probably not what he meant, you can call a function from within a code-block within a regex:
    $foo =~ /(?{match_foo()})/;

    ar0n ]