Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: substituting with hash data

by davorg (Chancellor)
on Aug 16, 2001 at 18:06 UTC ( [id://105385]=note: print w/replies, xml ) Need Help??


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>

Replies are listed 'Best First'.
Re: Re: substituting with hash data
by Cirollo (Friar) on Aug 16, 2001 at 18:11 UTC
    Speaking of which... if you're looking to do HTML templating, you might take a look at this nice overview of your options (written by perrin): Choosing a Templating System

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://105385]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (6)
As of 2024-04-23 15:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found