into Build.PL and Makefile.PL.
t/*_without_optional_dependencies.t
+t/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run
Makefile
Makefile.old
pm_to_blib
+ t/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run
>,
test_wrappers_to_generate(),
],
t/ControlStructures/ProhibitCStyleForLoops.run
t/ControlStructures/ProhibitDeepNests.run
t/ControlStructures/ProhibitMutatingListFunctions.run
-t/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run
+t/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run.PL
t/ControlStructures/ProhibitPostfixControls.run
t/ControlStructures/ProhibitUnlessBlocks.run
t/ControlStructures/ProhibitUnreachableCode.run
\.gdb_history$
\.ERR$
^t/.*_without_optional_dependencies.t$
+^t/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run$
# Temp/backup files
~$
'String::Format' => 1.13,
'Test::More' => 0,
},
- realclean => { FILES => join q< >, test_wrappers_to_generate() },
+ realclean => {
+ FILES =>
+ join
+ q< >,
+ test_wrappers_to_generate(),
+ 't/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run'
+ },
);
sub MY::postamble {
}
sub get_PL_files {
+ my %PL_files;
+
+ $PL_files{'t/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run.PL'} =
+ 't/ControlStructures/ProhibitNegativeExpressionsInUnlessAndUntilConditions.run';
+
if (should_skip_author_tests()) {
print
"\nWill not generate extra author tests. Set "
. '$ENV{TEST_AUTHOR} to a true value to have them generated.'
. "\n\n";
- return {};
+ }
+ else {
+ $PL_files{'t/generate_without_optional_dependencies_wrappers.PL'} =
+ [ test_wrappers_to_generate() ];
}
- return {
- 't/generate_without_optional_dependencies_wrappers.PL' => [
- test_wrappers_to_generate()
- ],
- };
+ return \%PL_files;
}
sub dump_unlisted_or_optional_module_versions {
=head1 DESCRIPTION
+ until ($foo ne 'blah') { #not ok
+ ...
+ }
+
+ while ($foo eq 'blah') { #ok
+ ...
+ }
+
A number of people have problems figuring out the meaning of doubly
-negated expressions. Cunless> and C<until> are both negative
+negated expressions. C<unless> and C<until> are both negative
constructs, so any negative (e.g. C<!~>) or reversible operators (e.g.
C<le>) included in their conditional expressions are double negations.
Conway considers the following operators to be difficult to understand
lt gt le ge cmp
+=head1 SEE ALSO
+
+L<Perl::Critic::Policy::ControlStructures::ProhibitUnlessBlocks>
+
=head1 AUTHOR
Elliot Shank C<< <perl@galumph.com> >>
. "This program: $this_program.";
}
-print "Generating $test_file_name.\n";
+print "\n\nGenerating $test_file_name.\n";
close $test_file;
-print "Done.\n";
+print "Done.\n\n";
#-----------------------------------------------------------------------------
our $VERSION = 1.078;
-print "Generating tests that hide modules and then run other tests.\n";
+print "\n\nGenerating tests that hide modules and then run other tests.\n";
my $this_program = __FILE__;
close $test_program;
}
-print "Done.\n";
+print "Done.\n\n";
__END__