my @pipeline <== gather { while $whatever # code here does its stuff and eventually issues: take $item; } } my $result = [max] @pipeline;