http://qs321.pair.com?node_id=105385


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.

--
<http://www.dave.org.uk>

Perl Training in the UK <http://www.iterative-software.com>