do you use double quotes to interpolate the string ?


Octavian Rasnita wrote:


Hi all,

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?

Thank you.

Teddy





-- 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