in reply to Finding names in files
a small change such as (untested):foreach($_){$count++;}; 033: if (($_ ne "Dave") && ($count <= 20)) 034: {
where the "!~" and the ".../i" make the regex fail if any variant of DAVE, dave, Dave, etc is present...foreach($_){$count++;}; 033: if (( $_ !~ /dave/i ) && ($count <= 20)) 034: {
However, my quick read and slow mind make me wonder if my logic (which follows yours) is correct -- ie, whether you really want a negative there... Resolution left as an exercise for the student...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Finding names in files
by gzayzay (Sexton) on Mar 29, 2006 at 17:32 UTC |