my %hash = @array; while ( my($k,$v) = each %hash ) { last if some_condition($k,$v); }