Octavian Rasnita <[EMAIL PROTECTED]> wrote:
:
: I have a text file that contains a text something like
: this:
:
: This text contains a $aa variable and a $bb variable
: and a $cc one.
:
: My program reads this text and I want to replace the
: variables with their values, then return the result
: string.
:
: How can I do this?
:
: Is using s/(\$\w+)/eval($1)/gse the only solution?
: (I haven't test it if it works this way yet, but I hope
: there is a simpler and easier method to evaluate the
: entire string.
: Is there such a way?

Octavian,

Have you looked at Text::Template? It does this (and some more)
but it requires delimiters around the variables.

HTH,

Charles K. Clarkson
--
Mobile Homes Specialist
254 968-8328



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to