use Loop::Watch; my $money = 1_000_000; # in USD # looping { ... } *does* loop ensure { $money > 0 } watching($money), looping { circle_globe(); }; sub circle_globe { move_to_next_location(); purchase_lodging(); eat(); # ... }