On 11/29/05, Mazhar <[EMAIL PROTECTED]> wrote: > > Hi Folks, > I have a requirement where in i have to read a file and then > store > the line by line items into a scalar variable. And then ihave ti match the > same. i am providing you a sample code. Just help how can i match a string > where in i should pass a scalar variable value. > > PGM > > Open (FILE1,">one Fuile"); > Open (FILE,">Second File"); > > while (<FILE1>) > { > $line1 = $_; > while (<FILE>) > { > $line = $_; > if ($line =~ /(.*)$line1(.*)/) (Here i have to check the > value which i get from a file but it is not searching) > { > print "Got the String"; > } > } > } > > > Open (FILE1,">one Fuile"); Open (FILE,">Second File");
Change this to, Open (FILE1,"<one Fuile"); Open (FILE,"<Second File"); > means write mode.