$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.
In reply to variable interpretation while reading from a file by amma
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |