summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/test
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-08-11 06:11:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-08-11 06:11:14 +0000
commitb40f07af73c1fdc8a9ed985c1d8d98bb43ca1556 (patch)
tree0b236d088d01fa1ec184489e1aeea9e970685795 /perl_checker.src/test
parentf42f06705611801422e19c76e41a9b44dc37ecda (diff)
downloadperl-MDK-Common-b40f07af73c1fdc8a9ed985c1d8d98bb43ca1556.tar
perl-MDK-Common-b40f07af73c1fdc8a9ed985c1d8d98bb43ca1556.tar.gz
perl-MDK-Common-b40f07af73c1fdc8a9ed985c1d8d98bb43ca1556.tar.bz2
perl-MDK-Common-b40f07af73c1fdc8a9ed985c1d8d98bb43ca1556.tar.xz
perl-MDK-Common-b40f07af73c1fdc8a9ed985c1d8d98bb43ca1556.zip
suggest better for !($foo == $bar) (same for eq, != and ne)
Diffstat (limited to 'perl_checker.src/test')
-rw-r--r--perl_checker.src/test/suggest_better.t4
1 files changed, 4 insertions, 0 deletions
diff --git a/perl_checker.src/test/suggest_better.t b/perl_checker.src/test/suggest_better.t
index 58a1308..caa3677 100644
--- a/perl_checker.src/test/suggest_better.t
+++ b/perl_checker.src/test/suggest_better.t
@@ -62,6 +62,10 @@ member($xxx, keys %h) you can replace "member($xxx, keys %yyy
!($xxx =~ /.../) !($var =~ /.../) is better written $var !~ /.../
+!($xxx == 1) !($foo == $bar) is better written $foo != $bar
+
+!($xxx eq 'foo') !($foo eq $bar) is better written $foo ne $bar
+
foreach (@l) { use "push @l2, grep { ... } ..." instead of "foreach (...) { push @l2, $_ if ... }"
push @l2, $_ if yyy($_); or sometimes "@l2 = grep { ... } ..."
}