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

Re: replacing "dynamic" variables

by bbfu (Curate)
on Apr 09, 2004 at 22:00 UTC ( #344042=note: print w/ replies, xml ) Need Help??

in reply to replacing "dynamic" variables

Update2: Also, you might want to look into one of the various Config or templating modules (such as Template-Toolkit), as it sounds like you might be trying to roll your own basic templating system.

$line =~ s[ \$ # Dollar sign (literal) { # Open brace (literal) ( # capture (into $1) [^}]+ # One or more non-close brace characters ) # end capture } # Close brace (literal) ][$dynamic_variables{$1}]xg;

Update: Expanded regexp with /x

Black flowers blossom
Fearless on my breath

Comment on Re: replacing "dynamic" variables
Download Code

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2015-11-27 17:05 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls