for my $top ( @topN ) { ## do something with $top }