C
c186282
I'm reading in a file line by line. Some of the lines have variables
that I would like to replace with the current values. For example the
contents of a line that I read in may look like this:
Hi there $$info{user} what are you going to do today?
I have this line in some variable say $line. How do I replace the text
$$info{user} with the actual value of $$info{user}? Of cores $info is a
reference to a hash in the running program.
Let me explain the motivation of the problem. Maybe someone will have
a better way to attack the problem. The script that I'm writing
collects information from a database then writes an input text file for
some other program. This text file has a lot of comments and additional
fluff along with lots of key value tags. I would like to have a template
text file that my scripts reads in and just adds the current relevant
information. Also I want a clean solution I do not want to have a
large case structure of replacements.
Thank you for your help.
that I would like to replace with the current values. For example the
contents of a line that I read in may look like this:
Hi there $$info{user} what are you going to do today?
I have this line in some variable say $line. How do I replace the text
$$info{user} with the actual value of $$info{user}? Of cores $info is a
reference to a hash in the running program.
Let me explain the motivation of the problem. Maybe someone will have
a better way to attack the problem. The script that I'm writing
collects information from a database then writes an input text file for
some other program. This text file has a lot of comments and additional
fluff along with lots of key value tags. I would like to have a template
text file that my scripts reads in and just adds the current relevant
information. Also I want a clean solution I do not want to have a
large case structure of replacements.
Thank you for your help.