#!/usr/bin/perl -w use strict; use Getopt::Long::Descriptive; my ($opt, $usage) = describe_options( 'my-program %o ', [ 'server|s=s', "the server to connect to" ], [ 'port|p=i', "the port to connect to", { default => 79 } ], [], [ 'verbose|v', "print extra stuff" ], [ 'help', "print usage message and exit" ], ); print($usage->text), exit if $opt->help; #### $ ./877972.pl --help my-program [-psv] [long options...] -s --server the server to connect to -p --port the port to connect to -v --verbose print extra stuff --help print usage message and exit #### sub _validate_with { my (%arg) = validate(@_, { # <-- line 442 name => 1, params => 1, spec => 1, opts => 1, usage => 1, });