summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/test/suggest_better.t
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-11-17 17:06:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-11-17 17:06:52 +0000
commit7d1cbb259c63a0cc56ba15433cdef208899e45e7 (patch)
treed4c6b5165f82b2b72a12c8d0a55593b06774519a /perl_checker.src/test/suggest_better.t
parentcab1e04c6458ab10cdb5ef03f125aee5668695ac (diff)
downloadperl-MDK-Common-7d1cbb259c63a0cc56ba15433cdef208899e45e7.tar
perl-MDK-Common-7d1cbb259c63a0cc56ba15433cdef208899e45e7.tar.gz
perl-MDK-Common-7d1cbb259c63a0cc56ba15433cdef208899e45e7.tar.bz2
perl-MDK-Common-7d1cbb259c63a0cc56ba15433cdef208899e45e7.tar.xz
perl-MDK-Common-7d1cbb259c63a0cc56ba15433cdef208899e45e7.zip
recognize a form of "find { ... } ..."
Diffstat (limited to 'perl_checker.src/test/suggest_better.t')
-rw-r--r--perl_checker.src/test/suggest_better.t7
1 files changed, 7 insertions, 0 deletions
diff --git a/perl_checker.src/test/suggest_better.t b/perl_checker.src/test/suggest_better.t
index e98e64f..d76abeb 100644
--- a/perl_checker.src/test/suggest_better.t
+++ b/perl_checker.src/test/suggest_better.t
@@ -92,6 +92,13 @@ foreach (@l) { use "push @l2, map { ... ? ... : () } .
push @l2, yyy($_) if zzz($_); or sometimes "@l2 = map { ... ? ... : () } ..."
} or sometimes "@l2 = map { if_(..., ...) } ..."
+foreach (@l) { use "$xxx = find { ... } ..."
+ if (xxx($_)) {
+ $xxx = $_;
+ last;
+ }
+}
+
if (grep { xxx() } @l) {} in boolean context, use "any" instead of "grep"
$xxx = grep { xxx() } @l; you may use "find" instead of "grep"