in reply to Re: Perl Boolean Evaluation Shows Incorrect Results
in thread Perl Boolean Evaluation Shows Incorrect Results
getting rid of all them leaning toothpicks
Another way to eliminate the leaning toothpicks is to single-quote the non-interpolating part of the replacement string before making the replacement:
my $rep = '$cTestH{$dbFile}{$timeRng}{$regionName}{'; my $bool = 'A&!B&!C'; $bool =~ s/([a-zA-Z]\w*)/$rep$1}/g;
Output:
12:55 >perl 1560_SoPW.pl Evaluating Test Condition: $cTestH{$dbFile}{$timeRng}{$regionName}{A}& +!$cTestH{$dbFile}{$timeRng}{$regionName}{B}&!$cTestH{$dbFile}{$timeRn +g}{$regionName}{C}... Result is: 1 12:55 >
Hope that helps,
| Athanasius <°(((>< contra mundum | Iustus alius egestas vitae, eros Piratica, |
|
|---|