Question

GetOptions(
    "r|repo=s"       =>   \$repo,
    "R|list-repos"   =>   \$list,
);

When I call this script with -r qwe option, $list is updated to 1, which is not what I expect.

How can I make GetOpt case sensitive?

Was it helpful?

Solution

use Getopt::Long qw(:config no_ignore_case);

OTHER TIPS

Also enabling bundling fixes it too:

use Getopt::Long  qw(:config bundling);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top