brassbin has asked for the wisdom of the Perl Monks concerning the following question:
hi,
i'm trying to invoke a subroutine on the occurrence of certain option, say something like this
GetOptions( 'test=s{3}' => \&sub1 ); sub sub1 { print @_ }
running the script with
prog --test a b c
would yield a result like this
test a
test b
test c
as if the sub was called 3 times, each with 1 of the 3 values passed in, how do i make it so that all 3 values of the option are passed to @_ once with one invocation of the subroutine?
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Getopt::Long subroutine question
by Loops (Curate) on Jul 22, 2013 at 21:27 UTC | |
Re: Getopt::Long subroutine question
by 2teez (Vicar) on Jul 23, 2013 at 03:48 UTC | |
by Loops (Curate) on Jul 23, 2013 at 04:20 UTC | |
by 2teez (Vicar) on Jul 23, 2013 at 05:00 UTC | |
Re: Getopt::Long subroutine question
by kcott (Archbishop) on Jul 23, 2013 at 13:38 UTC | |
by brassbin (Novice) on Jul 23, 2013 at 17:42 UTC |
Back to
Seekers of Perl Wisdom