in reply to Re^2: Use of uninitialized value $_ in string
in thread Use of uninitialized value $_ in string
... 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
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?GetOptions ( 'domain=s' => \$domain, 'client=s' => \$client, 'job-code:i' => \$job_code, 'help' => &usage() ) or &usage();
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."
In Section
Seekers of Perl Wisdom