in reply to substituting with hash data
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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: substituting with hash data
by Cirollo (Friar) on Aug 16, 2001 at 18:11 UTC |