Perl Getopt Long The module check wrong argument…

Perl Getopt::Long.

The module check wrong argument but does not check when no argument is provided.
In order to check if there is no argument as well as wrong argument,
check the argument also.

GetOptions( 'test=s' => \$option_test )
    or exit(1);

defined($option_test)
    or die("Missing argument -t");

http://www.perlmonks.org/?node_id=789974

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *