jjmoka has asked for the wisdom of the Perl Monks concerning the following question:
Is there any way to pass the arguments from a previously built scalar/hash/array ?use Getopt::Long qw(GetOptions); my $arg1; GetOptions( 'arg1=s' => \$arg1);
I tried different ecaping (i.e. \$, \\$, \\\$),use Getopt::Long qw(GetOptions); my arg1; my $opt = 'arg1=s => \$arg1'; my @opt = ('arg1=s', '\$arg1'); my %opt = ('arg1=s' => '\$arg1'); GetOptions($opt); #doesn't work GetOptions(@opt); #doesn't work GetOptions(%opt); #doesn't work
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Any way to call GetOptions with evaluated / interpoltated args ?
by LanX (Saint) on Nov 26, 2018 at 16:15 UTC | |
Re: Any way to call GetOptions with evaluated / interpoltated args ?
by Eily (Monsignor) on Nov 26, 2018 at 16:16 UTC | |
by jjmoka (Beadle) on Nov 26, 2018 at 16:43 UTC | |
Re: Any way to call GetOptions with evaluated / interpolated args ?
by hippo (Archbishop) on Nov 26, 2018 at 16:41 UTC | |
Re: Any way to call GetOptions with evaluated / interpoltated args ?
by tinita (Parson) on Nov 26, 2018 at 19:36 UTC | |
Re: Any way to call GetOptions with evaluated / interpoltated args ?
by 1nickt (Canon) on Nov 26, 2018 at 16:16 UTC |