Jim wrote:

> ...  It doesn't because when $back returns $1 as a valid return from the
> regex then $1 remains a valid rval for the condition for $line.  I need to
> get around that!

Don't test on $1.  Since we now know that it stays set after a successful match,
we know it is not a valid test.  Test on the opertion itself, or assign the
operation itself to a scalar, aqnd test on that.  Now I know why this snippet
from your original post raised a red flag for me:
> $var =~ /.*? \(.*\) (.*?) \(.*?\)/;
I saw it, and wondered "Well, what is he doing with it?".  The matching function
is intended to return a true value on success, and that value is assigned to your
blandly-named $var, yet it is never used.

Try instead:
if  ($var =~ /.*? \(.*\) (.*?) \(.*?\)/;) ) {
  # anything referring to regex variables should come within this scope.
}

Joseph


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to