use Term::ShellUI; system(start); my $term = new Term::ShellUI( commands => { "quit" => { desc => "Quit this program", maxargs => 0, method => sub { shift->exit_requested(1); }, }}, ); $term -> prompt("My Prompt>"); $term->run();