amma has asked for the wisdom of the Perl Monks concerning the following question:
$name = guest; $id = 1; open(SOURCE, "<file1.txt"); open(SINK, ">file2.txt"); while (<SOURCE>) { #open(DATA,"<pattern.txt"); while ( <DATA> ) { print SINK "$_" if /startpattern/ .. /Endpattern/; } } __DATA__ #start pattern my name is $name blahhhhhhh my id is $id blahhhh #Endpattern
The variables are not interpreted while writing to the SINK file. What I am missing here? How to interpret the variables.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: variable interpretation while reading from a file
by boftx (Deacon) on Nov 29, 2013 at 10:09 UTC | |
by amma (Novice) on Nov 29, 2013 at 11:35 UTC | |
|
Re: variable interpretation while reading from a file
by Anonymous Monk on Nov 29, 2013 at 10:37 UTC | |
|
Re: variable interpretation while reading from a file
by ww (Archbishop) on Nov 29, 2013 at 14:23 UTC | |
by choroba (Cardinal) on Nov 29, 2013 at 14:31 UTC | |
by ww (Archbishop) on Nov 29, 2013 at 16:06 UTC |