in reply to Open File / Search-match
If you like perlmonks, register and log in - it's fun!
I guess the right group for your question would be "Seekers for Perl Wisdom" and not "Discussion".
Concerning your problem:
... may point in the right directionuse strict; # always do so (first thing I learned) my $file = 'database'; my @result; open(INF,$file) || die "Can't open $file: $!\n"; while (<INF>) { # while walking through file if(/???/) { # if you match your searchstring # you have to replace ??? by a regex push @result,$_; # write current line to array } }
HTH
|
|---|