G'day dr_jkl,
Probably a typo: I'll assume my $opt should be my %opt.
If %opt is in scope, you can modify it whenever you want. So, the question seems to boil down to how to get the value to assign to $opt{input}.
The Getopt::Long documentation has a Mixing command line option with other arguments section. Is this of any help?
An example of what you want to type on the command line would be useful.
I'm guessing your code looks something like:
my %opt = ( ... ); GetOptions( ... ); # get value for $opt{input} here if ($opt{input} eq 'something') { # do something here } else { # do something else here }
Filling in the blanks (or correcting my guess) would probably lead to a better answer.
-- Ken
In reply to Re: non-option argument question
by kcott
in thread non-option argument question
by dr_jkl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |