use Term::ShellUI; my $term = new Term::ShellUI( commands => { "exit" => { desc => "Quit this program", maxargs => 0, method => sub { shift->exit_requested(1); }, }, "help" => { desc => "This is a help file",maxargs => 3, method=> sub { my $self = shift; my $parms = shift; my $args = shift; my $args1 = shift; my $args2 = shift; print "\n $self "; print "\nThe first Arg is : $args\n"; print "\nThe secnd Arg is : $args1\n"; print "\nThe Third Arg is : $args2\n"; }}, }, ); $term -> prompt("SAS>"); $term->run();