in reply to reg ex matching 101
change that to be:Broken: while ($line = <READTHIS>) { if ($line =~ /cat/) { print "yeppers!"; } }</I>
Keep in mind, you are going to get any match on cat like "catching" a cold...I dunno if you wanted that or not. If you don't mind me asking, what was your intent for the script? I was trying to figure out what you were up to with the search and replace lines. In some of those you are searching for a set of characters and replacing them with the identical data.while(<READTHIS>){ if($_ =~ /cat/) { print "Yeppers!\n" } else{ print $_; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: RE: reg ex matching 101
by Petruchio (Vicar) on Oct 07, 2000 at 08:36 UTC | |
|
RE: RE: reg ex matching 101
by chromatic (Archbishop) on Oct 07, 2000 at 20:22 UTC | |
by 2501 (Pilgrim) on Oct 08, 2000 at 03:40 UTC |