Line 4 uses $file while line 1 has that var as $file1. Had you used strict and warnings you were have known this. But maybe it's merely a transcription typo; otherwise, contrary to your statement, you could *NOT* have "read the data from first file...."
As others noted, you should read perldoc -f open and use the three-arguement open described there.
In reply to Re: Read strings from a file, search and replace same string in another file.
by ww
in thread Read strings from a file, search and replace same string in another file.
by premal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |