Do you mean something like:
my $srch = join ('|', map {'\b.'quotemeta($_).'\b'} keys %trans); $text =~ s/($srch)/$trans{$1}/g;
Looks like you're writing your own templating system. There are plenty of them on CPAN, why not look for one there.
--Perl Training in the UK <http://www.iterative-software.com>
In reply to Re: substituting with hash data
by davorg
in thread substituting with hash data
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |