in reply to $1 don't reset (non loop)
Why doesn't $1 reset when the regexp doesn't match anything?
It's a feature, not a bug :-)
Actually there are times when it comes in handy, if I'm doing stuff where I need it to be redefined I usually use an if {} elsif{} else{} loop. That way it only goes into the {} if the if (or elsif) matches. If you don't want to use an elsif (because you are checking a few things) just use multiple if statements.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: $1 don't reset (non loop)
by jockel (Beadle) on Feb 17, 2004 at 14:01 UTC |