use strict; use warnings; sub a { my $x = shift; if ( $x < 0 ) { print "done\n"; } else { b($x - 2); } } sub b { return a(shift() + 1); } a(5);