in reply to Re: Will a substitution in an if/else loop default to $_?
in thread Will a substitution in an if/else control structure default to $_?
if (/\xa0/) { s/\xa0\d+/ /; } else { s/\xa0//; }
If the match in the condition expression of the if-statement for \xa0 somewhere in the string (whether the regex is bound to the string in $_ or $cellStr) fails, how can any substitution involving that character be made in the false clause of the if-statement?
If the match succeeds, isn't it also redundant since the \xa0 character also appears in the substitution regex in the true clause of the if-statement?
|
|---|