Utrecht has asked for the wisdom of the Perl Monks concerning the following question:
My question: How can I parse an array by executing the filename with the option "-f test_1 test_2"use Getopt::Long ; my $input = {output_type => 'default'} ; my @input_array = {output_type => 'default'} ; my $p = new Getopt::Long::Parser ; $p->configure('pass_through') ; my $getoptret = $p->getoptions( + 'files|f:s' =>\@input_array->{files}, #filename(s) 'eventlist|e:s' =>\$input->{eventlist}, #name of the eve +ntlist 'output_directory|o:s' =>\$input->{output_directory}, # desire +d output directory ); die "Error: Give input SEED volume\n" if (! -e @input->{files}) ; die "Error: Give name of eventlist that should be used\n" if (! $input +->{eventlist}) ; die "Error: Give output directory\n" if (! $input->{output_directory}) + ;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: get array from getoptions
by ctilmes (Vicar) on Aug 19, 2008 at 16:46 UTC | |
|
Re: get array from getoptions
by psini (Deacon) on Aug 19, 2008 at 18:48 UTC | |
|
Re: get array from getoptions
by ctilmes (Vicar) on Aug 19, 2008 at 16:59 UTC |