my @Files = ( ..... ); # List of file names here.
my @record = ( );
my $pattern = "whatever";

foreach $file(@Files)
{    open FH, $file;
        while (<FH>)
        { push @record, $file if ($_ =~ /$pattern/ig) }
      close (FH)
}

######

@record will probrably grabbed all the file names while
contained "whatever" .
Code not tested, just for reference =)

Rgds,
Connie



----- Original Message -----
From: "Vishal Kapoor" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, July 15, 2002 10:41 PM
Subject: Reading from a bunch of files.


> Hi,
> I want to read a few files and search for a particular word. I want to
then
> print a list of all the files with that word.
> Any ideas ??
> Thanx..
>
> Vishal Kapoor
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to