I have an existing Perl script which has many command line options which are processed using Getopt::Std (getopts function). But, I want to add 2 new options: --testrun and --cfgarray.
I used use Getopt::Long; and GetOptions('testrun' => \$test_flag); "--testrun" takes no argument. I simply used it as a flag like if($test_flag). It works when run separately. But, since in my Perl script there is both use Getopt::Long; and use Getopt::Std;, I get error:
unknown options
from getopts api (when it is called before GetOptions). Can both Getopt::Std and Getopt::Long be used in a single Perl script?