nave448 has asked for the wisdom of the Perl Monks concerning the following question:
my $str = "string to be matched"; opendir(TEMP,'/ade/nachekur_view2/oracle/work/hosts/brhost3/br/xcr')or + die "cannot open dude \n" ; my @FILES=readdir TEMP; my $fi = scalar (@FILES); for (my $k = 0; $k < $fi ; $k++) { open (F,$FILES[$k]) or die " rey ledhu ra \n"; my @lines = <F>; for (@lines) { if ($_ =~ m/$str/) { print "$_\n"; print "Lined that matched $str in $FILES[$k] \n"; last ; } } } closedir(TEMP); }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Problem with regex
by johngg (Canon) on Sep 16, 2008 at 13:13 UTC | |
by mpeever (Friar) on Sep 16, 2008 at 13:56 UTC | |
by johngg (Canon) on Sep 16, 2008 at 14:49 UTC | |
by mpeever (Friar) on Sep 16, 2008 at 17:11 UTC | |
|
Re: Problem with regex
by svenXY (Deacon) on Sep 16, 2008 at 11:17 UTC | |
by nave448 (Novice) on Sep 16, 2008 at 11:25 UTC | |
|
Re: Problem with regex
by llancet (Friar) on Sep 16, 2008 at 11:31 UTC | |
by moritz (Cardinal) on Sep 16, 2008 at 12:12 UTC | |
by nave448 (Novice) on Sep 16, 2008 at 11:36 UTC | |
|
Re: Problem with regex
by Sagacity (Monk) on Sep 16, 2008 at 14:08 UTC |