c:\@Work\Perl\monks>perl -wMstrict -le
"for my $s (qw(p X)) {
printf qq{for '$s' case };
unless ( (!($s =~ /p/)) && (!($s =~ /q/)) && (!($s =~ /r/)) ) { pri
+nt 'A' }
unless ( $s =~ /p/ or $s =~ /q/ or $s =~ /r/ ) { pri
+nt 'B' }
}
"
for 'p' case A
for 'X' case B
My understanding of haukex's point here is that the two if/unless-statement syntaxes that ovedpo15 was worried about are exactly equivalent, and so the condition expression doesn't have to change at all.
If I had written the original code, I think I would have written something very much along the lines you and GrandFather suggest (or like this). But if the original condition expression was correct, convoluted as it was, and did not have to change, I would say it was the better part of wisdom to just leave it alone.
I don't think we're really very far part on this one. :)
Give a man a fish: <%-{-{-{-<
|