in reply to Storing a variable in a file and processing within the script
What you're trying to do is not a good idea. The contents read in from '$inputfile' is text. Using that text as a reference to a variable is a way to ask for all sorts of pain.
My suggestion would be to put a plain text 'placeholder' and then do a search and replace within your script.
select * from all_tables where table_name = 'PLACEHOLDER'
$readline =~ s/PLACEHOLDER/$table_name/;
Because trust me - using variable names as 'plain text' is bad news for all sorts of reasons. If you're really set on going that way, you will want to look at 'references'. See: perlreftut.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Storing a variable in a file and processing within the script
by tony@perlmonks.org (Initiate) on Jul 17, 2013 at 16:13 UTC | |
|
Re^2: Storing a variable in a file and processing within the script
by Anonymous Monk on Jul 17, 2013 at 15:31 UTC |