On Mon, Jul 15, 2002 at 02:43:14PM -0700, John W. Krahn wrote:
> Vishal Kapoor wrote:
> >
> > 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 ??
>
> perl -lne'/\bparticular\b/&&print($ARGV)&&close(ARGV)'
Vishal Kapoor wrote:
>
> 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 ??
perl -lne'/\bparticular\b/&&print($ARGV)&&close(ARGV)' yourfiles*
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-ma
On Jul 15, Vishal Kapoor said:
>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.
my @hits;
my $word = "japhy";
{
local @ARGV = @files_to_search;
while (<>) {
if (index($_, $word) != -1) {
push
On Mon, Jul 15, 2002 at 11:23:52PM +0800, Connie Chan wrote:
> my @Files = ( . ); # List of file names here.
> my @record = ( );
> my $pattern = "whatever";
>
> foreach $file(@Files)
> {open FH, $file;
> while ()
> { push @record, $file if ($_ =~ /$pattern/ig) }
> cl
my @Files = ( . ); # List of file names here.
my @record = ( );
my $pattern = "whatever";
foreach $file(@Files)
{open FH, $file;
while ()
{ push @record, $file if ($_ =~ /$pattern/ig) }
close (FH)
}
##
@record will probrably grabbed all the file names while
con