(Please before flagging the question, read it first! I know that similar questions have been asked, yet in different and incomplete forms).
I'm trying to find what the natural and normal way is to handle command line arguments or script options. Assume that script may take any possible type of arguments or options. For example:
./myscript.pl runabnormal --help /sbin/proc -f filename CONFIG=set.config LOG=me.log
The best way that I'm aware of so far is by using Dumper
as follows:
use strict;
use warnings;
use Data::Dumper qw(Dumper);
print Dumper \@ARGV;
output:
$VAR1 = [
'runabnormal',
'--help',
'/sbin/proc',
'-f',
'filename',
'CONFIG=set.config',
'LOG=me.log'
];
Any general advice on this? How do perl programmers usually handle the complicated arguments input to their scripts?