... the script still does nothing.
[root@wsprod01 myperl]# ./test.pl --domain google.com --client google
Usage: ./test.pl --domain companydomain.com --client company [--job-co
+de 12345] [--help].
In the code shown in the OP, in the statement
GetOptions (
'domain=s' => \$domain,
'client=s' => \$client,
'job-code:i' => \$job_code,
'help' => &usage()
) or &usage();
the
'help' key is given the value of whatever is returned by a
call to the
usage() function. Problem is, this function returns nothing; rather, it calls
die to print a usage message, so program execution will never get past the
GetOptions() function call. Is this what you intend?
Updates:
- If you want to assign the 'help' key a reference to the usage() function,
'help' => \&usage,
would be the correct expression.
- Added italic emphasis in "... a call to the usage() function."