J
jkatz
Can I force variable interpolation on a file read?
I'd like the two print statements below to produce the same
results.....
(where the file myinputfile just contains the exact characters in $line
below--
without the quotes of course. )
#!/usr/bin/perl -w
$myvalue="girl";
$line= "It's a $myvalue ";
print $line."\n";
open (INPUT, "<myinputfile");
$line=<INPUT>;
print $line."\n";
Alternatively, how could I use a s/// to make the substitution?
(I want the substitution to work automatically for ANY variable I might
have
set earlier in the perl file.)
Thanks in advance for your help!
LCK
I'd like the two print statements below to produce the same
results.....
(where the file myinputfile just contains the exact characters in $line
below--
without the quotes of course. )
#!/usr/bin/perl -w
$myvalue="girl";
$line= "It's a $myvalue ";
print $line."\n";
open (INPUT, "<myinputfile");
$line=<INPUT>;
print $line."\n";
Alternatively, how could I use a s/// to make the substitution?
(I want the substitution to work automatically for ANY variable I might
have
set earlier in the perl file.)
Thanks in advance for your help!
LCK