Parse CLI Arguments with Getopt::Long
Parse long and short options with type validation using Getopt::Long.
Author:
chris
// Language: Perl
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
my $verbose = 0;
my $count = 1;
my $name = '';
GetOptions(
'verbose|v' => \$verbose,
'count|c=i' => \$count,
'name|n=s' => \$name,
) or die "Bad options\n";
print "name=$name count=$count verbose=$verbose\n";