From 7d1cbb259c63a0cc56ba15433cdef208899e45e7 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 17 Nov 2004 17:06:52 +0000 Subject: recognize a form of "find { ... } ..." --- perl_checker.src/test/suggest_better.t | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'perl_checker.src/test/suggest_better.t') 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" -- cgit v1.2.1