I guess instead of using $_, you can use something like
i haven't tried it, but i think this is how it's donemy @lines = <FILE>; while (<FILE>) { if ($_ =~ /nine/) { print "found\n"; } else { print "not found\n"; } }
In reply to Re^3: how to search for a string in a particular file?
by tm86
in thread how to search for a string in a particular file?
by tm86
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |