in reply to matching an array

You might mean like this:
open (FILE1, "<tabtext.txt"); open (FILE2, ">ludo.txt"); foreach my $paramKey (@params){ while(<FILE1>){ if (/$paramKey.*$/){ print FILE2, "\n"; } } close(FILE1); close(FILE2);
Edit: I put the open/close functions in the right place. So now it doesn't overwrite ludo.txt for every loop.

Replies are listed 'Best First'.
Re: Re: matching an array
by Anonymous2003 (Initiate) on Aug 08, 2003 at 13:19 UTC
    It doesn't print anything in the file! Why?
      Because open (FILE2, ">ludo.txt"); overwrites ludo.txt every time through the $paramKey loop.

      --

      flounder