Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: substituting with hash data

by davorg (Chancellor)
on Aug 16, 2001 at 18:06 UTC ( #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? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (1)
As of 2023-03-30 19:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which type of climate do you prefer to live in?






    Results (74 votes). Check out past polls.

    Notices?