in reply to Re^2: How to check if a scalar value is numeric or string?
in thread How to check if a scalar value is numeric or string?
Your requirement mentions GetOptions. Does this mean you are using Getopt::Long? If so, how are you specifying the option? opt=s, opt:s, opt=i, opt:i, opt, etc?
Getopt::Long is usually good about setting sane values. If you asked for an integer with :i, it will set your value to 0 if there was no argument given, so you can test with exists to see if it was set.
|
---|