Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re: Parsing a string from a file

by mda2 (Hermit)
on Jun 13, 2005 at 01:39 UTC ( #466024=note: print w/replies, xml ) Need Help??


in reply to Parsing a string from a file

Today you have many template tools (Template::Tolkit, HTML::Mason, etc). But if you need a single template for pages you can use reserved words to do it.

For example, use TIME and COUNT to replace messages...

foreach $message (@messages) { $message =~ s/TIME/$time/g; $message =~ s/COUNT/$count/g; print "$message<br />"; }

But if you need many reserved words it can have more or less cpu costs...
But it more secure with use eval...

--
Marco Antonio
Rio-PM

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (3)
As of 2019-12-07 16:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (162 votes). Check out past polls.

    Notices?