Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Perl GetOptions() case sensitivity

Tags:

People also ask

What is GetOptions in Perl?

In Perl, GetOptions() is defined as a function that is an extended function of Getopt::Long module which is mainly for parsing the command line using various options and this function uses functions that have long names instead of characters which are declared using a double dash (–).

Is Perl case sensitive?

Perl is a case sensitive programming language. Thus $Manpower and $manpower are two different identifiers in Perl.

What is Getopt long in Perl?

Getopt::Long is the Perl5 successor of newgetopt.pl . This was the first Perl module that provided support for handling the new style of command line options, in particular long option names, hence the Perl5 name Getopt::Long. This module also supports single-character options and bundling.


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?