kirankv123
Programmer
Hi,
I have then input file as follows:
input.txt file:
c:\\Data\$var1\files firstfile
c:\\Data\$var2\files secondfile
and $var1 and $var2 are exported and available through ENV.
In my Perl program, I would like to read the file and get the contents with values of $var1 & $var2 not as $var1/$var2.
export var1 = Data_Files1
export var2 = Data_Files2
But if I have the same content in the string variables then I am getting the values easily as per the expectations.
my $str1 = "c:\\Data\$var1\files"
my $str2 = "c:\\Data\$var2\files"
print $str1, $str2;
open (IN_FILE, "input.txt")
foreach $line(<IN_FILE>){
print $line; }
The above statement is displaying the same content as in file. But I am looking with the value of variables.
I have then input file as follows:
input.txt file:
c:\\Data\$var1\files firstfile
c:\\Data\$var2\files secondfile
and $var1 and $var2 are exported and available through ENV.
In my Perl program, I would like to read the file and get the contents with values of $var1 & $var2 not as $var1/$var2.
export var1 = Data_Files1
export var2 = Data_Files2
But if I have the same content in the string variables then I am getting the values easily as per the expectations.
my $str1 = "c:\\Data\$var1\files"
my $str2 = "c:\\Data\$var2\files"
print $str1, $str2;
open (IN_FILE, "input.txt")
foreach $line(<IN_FILE>){
print $line; }
The above statement is displaying the same content as in file. But I am looking with the value of variables.