in reply to next if attempt
use strict; my $wordOne = 'longwordOne'; my $wordTwo = 'anotherLongWord'; my $wordThree = 'thirdLongHere'; while (<DATA>) { next if ($_ =~ /(?:$wordOne|$wordTwo|$wordThree)/gi); print ; } exit; __DATA__ blah blah longwordOne blah blow blow blee anotherLongWord glgl thirdLongHere fddsf ds sdfs fs fsd fggh hg longwordOne sdasd
and the next can be written more succinctly as:blow blow fddsf ds sdfs fs fsd sdasd
next if /$wordOne|$wordTwo|$wordThree/i;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: next if attempt
by LTjake (Prior) on Jul 16, 2003 at 13:18 UTC | |
by particle (Vicar) on Jul 16, 2003 at 13:40 UTC | |
by Aristotle (Chancellor) on Jul 16, 2003 at 15:19 UTC | |
by hardburn (Abbot) on Jul 16, 2003 at 14:03 UTC | |
by particle (Vicar) on Jul 16, 2003 at 15:03 UTC |