for my $splort (foo()) { do { chop($splort); last if $splort eq $root; } until (happy($splort)); print "happy or root\n"; }