stallion has asked for the wisdom of the Perl Monks concerning the following question:
Scenario: A variable is mentioned in multiple file names and im able to grep once only. I want the file names in which the variable is mentioned whereas im able to grep only one file name.
sub module{ my $File1 = $File::Find::name; $File1 =~ s,/,\\,g; if ( $File1 =~ /.+\.doc/i) { open FILE, $File1 ; if ( grep /$variable/, <FILE> ) { $FOUND = 1; $FUN1 = $_; } close FILE; } } return 1;
Here $variable contains the search tag.. Any suggestions how to proceed Thanks
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Multiple file handling
by moritz (Cardinal) on Sep 12, 2012 at 14:38 UTC | |
Re: Multiple file handling
by tobyink (Canon) on Sep 12, 2012 at 14:56 UTC |
Back to
Seekers of Perl Wisdom