c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my @list = (rand(1), rand(1), rand(1)); dd \@list; ;; my $less = 1; for (@list) { $less = 0, last if $_ >= 0.5; } print 'for: all satisfy the condition' if $less; ;; my $any = grep { $_ >= 0.5 } @list; print 'grep: none fail the condition' if not $any; " [0.860137939453125, 0.796112060546875, 0.875457763671875] c:\@Work\Perl\monks>perl -wMstrict -MData::Dump -le "my @list = (rand(1), rand(1), rand(1)); dd \@list; ;; my $less = 1; for (@list) { $less = 0, last if $_ >= 0.5; } print 'for: all satisfy the condition' if $less; ;; my $any = grep { $_ >= 0.5 } @list; print 'grep: none fail the condition' if not $any; " [0.134674072265625, 0.332855224609375, 0.4288330078125] for: all satisfy the condition grep: none fail the condition