in reply to problem while reading multiple files

You've been around long enough that you should know to post code, as you did in problem while searching for a pattern in a file. Read and meditate on How (Not) To Ask A Question.

A rough outline for your code would be:

  1. open F1
  2. open F2
  3. Slurp F2 into an array
  4. For every line in F1 (perhaps using I/O Operators in a while loop)
    1. Check if the variable containing F2 contains the line in question, perhaps using a regular expression and grep.
    2. If yes, print the line.

If you do not know how to do any of these steps and have read the documentation, post specific questions with code (or at least pseudocode), sample input and expected output. Perlmonks is here to help you help yourself.

  • Comment on Re: problem while reading multiple files

Replies are listed 'Best First'.
Re^2: problem while reading multiple files
by rajyalakshmi (Acolyte) on Jul 16, 2010 at 09:21 UTC
    I followed the steps,it solved the problem..Thanks a lot everyone