This works, but it is certainly not the best way to do it:
$file= '<A NAME="TOC124" HREF="cvs.html#SEC124">A.8 commit--Check file +s into the repository</A>'; $c->{Anchor}{from}='<A NAME="(.*?)" HREF=".*?\#(.*?)">(.*?)</A>'; $c->{Anchor}{to}='$3 |$2| *$1*'; foreach $item (keys %$c) { $from=$c->{$item}{from}; $to=$c->{$item}{to}; eval "\$file=~s/\$from/$to/sg"; } print "$file\n"; # A.8 commit--Check files into the repository |SEC124| *TOC124*
In reply to Re: how to evaluate a variable in a string?
by fglock
in thread how to evaluate a variable in a string?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |