s/// and friends first parse their contents as double
quoted strings, before ever considering the content
as a regex.

So you can do:

    $foo = '[a-';
    $bar = 'z]';

    s/$foo$bar//gi;

and it will work (stripping letters).

Furthermore, you don't need any dynamic behavior
for the search part of the s///, so it's fair to view it as
just a string, with subs being used to make a var
that contains the string.

Enough preamble.

One way is to keep your sub, but use it this way:

$search = 
    standard_search(Call Log) .
    standard_search(Billing Log) .
    standard_search(My Account) .
    standard_search(Help) .
    standard_search(Calling Plans);

s{ $search } { $3 $1 $2 $5 $4 }gx;

hth.

Reply via email to