# Top level my $choice = get_choice(); do_ip_manual() if $choice == 1; do_ip_fromfile() if $choice == 2; # Lower level sub do_ip_manual { my ($user, $pass) = get_auth(); ... } # Even lower level ...