kranthi has asked for the wisdom of the Perl Monks concerning the following question:
Is there any alternate way to get the three arguments directly without declaring the variables?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();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to retrieve arguments of command using Term::ShellUI
by pc88mxer (Vicar) on Jun 05, 2008 at 14:59 UTC |