|Syntactic Confectionery Delight|
Storing a variable in a file and processing within the scriptby email@example.com (Initiate)
|on Jul 17, 2013 at 14:58 UTC||Need Help??|
firstname.lastname@example.org has asked for the
wisdom of the Perl Monks concerning the following question:
Hi Guys, I have a plain text file with a sql statement and want to put a variable name within it, which should be read by my perl script.
So for example: There is a a file called input.txt with the SQL content as below. Notice the $table_name intended to be processed within the script.input.txt Text File content :
select * from all_tables where table_name = '$table_name'
Perl Script readSQL.pl:
If I execute the script, it reads the file but treats the $table_name as a string. How can I tell perl to treat it as a variable and assign the $table_name value declared at the start of the script to this value?
Thanks for any inputs on this..