I wrote a script that needs to get few arguments from the user, and I encountered a problem while trying to read my script arguments.
The script can get the -type for running the functions on one file type or can get the flag -all in order to run on all file types.
my $opt = GetOptions (
'help|h' => \$help,
'type=s' => \$type,
'all' => \$all,
);
I am trying to think about all the wrong options that a user can run and found that when the user is running myscript.pl -type -all, the module reads the -all as the -type string.
Is there any elegant way to avoid such a thing?