Subject: | inverted logic in network test sample code |
The sample code (copied below) from poe-gen-tests inverts the logic in
creating the run_network_tests file - it creates the file if the user
enters 'y' - "yes the user wants to skip the tests".
my $prompt = (
"Some of POE's tests require a functional network.\n" .
"You can skip these tests if you'd like.\n\n" .
"Would you like to skip the network tests?"
);
my $ret = "n";
if (grep /^--default$/, @ARGV) {
print $prompt, " [$ret] $ret\n\n";
}
else {
$ret = prompt($prompt, "n");
}
my $marker = 'run_network_tests';
unlink $marker;
if ($ret =~ /^Y$/i) {
open(TOUCH,"+>$marker") and close TOUCH;
}
print "\n";