use Loop::Watch; my ($age, @companies); $age = 20; ensure { $age < 35 and @companies < 10 } watching($age, \@companies), looping { $age++ if new_year(); if (my $c = acquisition_available()) { if (try_to_purchase($c)) { push @companies, $c; check_related($c); } } };