I've just been asked for the first time in a code review to check the return code from a call to the GetOptions()
function of the Getopt::Long
Perl module.
I cannot remember ever seeing such a test for the GetOptions()
function.
So is there a specific reason why people don't generally check the return code of this function?
GetOptions
if I want to make the programmdie
on errors when parsing command line arguments. Likedie unless GetOptions(...)
. If notpass_trough
is still an option to catch the rest of the arguments in@ARGV
. – Vasques