From c2f200920f04dba0874c054038770a91a71fbba5 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 7 Jan 2003 13:22:28 +0000 Subject: use "if any" instead of "if grep", and various other occurences of "any", "every", "partition" --- perl-install/interactive.pm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'perl-install/interactive.pm') diff --git a/perl-install/interactive.pm b/perl-install/interactive.pm index a09f68f37..efc823418 100644 --- a/perl-install/interactive.pm +++ b/perl-install/interactive.pm @@ -306,7 +306,7 @@ sub ask_from_normalize { $e->{type} ||= 'combo'; if (!$e->{not_edit}) { - die q(when using "not_edit" you must use strings, not a data structure) if ref ${$e->{val}} || grep { ref $_ } @$li; + die q(when using "not_edit" you must use strings, not a data structure) if ref ${$e->{val}} || any { ref $_ } @$li; } if ($e->{type} ne 'combo' || $e->{not_edit}) { ${$e->{val}} = $li->[0] if !member(may_apply($e->{format}, ${$e->{val}}), map { may_apply($e->{format}, $_) } @$li); @@ -360,11 +360,11 @@ sub ask_from_ { sub ask_from_no_check { my ($o, $common, $l) = @_; ask_from_normalize($o, $common, $l); - $o->ask_fromW($common, [ grep { !$_->{advanced} } @$l ], [ grep { $_->{advanced} } @$l ]); + $o->ask_fromW($common, partition { !$_->{advanced} } @$l); } sub ask_from_real { my ($o, $common, $l) = @_; - my $v = $o->ask_fromW($common, [ grep { !$_->{advanced} } @$l ], [ grep { $_->{advanced} } @$l ]); + my $v = $o->ask_fromW($common, partition { !$_->{advanced} } @$l); %$common = (); $v; } -- cgit v1.2.1