Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Array of filehandles

by Rahul6990 (Beadle)
on Apr 29, 2013 at 07:06 UTC ( [id://1031167]=note: print w/replies, xml ) Need Help??


in reply to Array of filehandles

Hi, I would prefer

my @matching_file; foreach $file (@file_list) { open (my FH, '<', $file); while(<FH>) { if(/<your pattern>/) { push(@matching_file,$file); #Store files in which pattern is pres +ent. last; #Once the pattern is found no need to iterate further the +same file. } } }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1031167]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (2)
As of 2024-07-15 20:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.