-
-
Save vyuh/00453cb3fe90d6d4057a4ccf2328d33d to your computer and use it in GitHub Desktop.
Use of Getopt::Long after reading 'perldoc GetOpt::Long'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl | |
use strict; | |
use warnings; | |
use autodie; | |
use feature qw(say); | |
use open ':std', ':encoding(UTF-8)'; | |
use Getopt::Long; | |
use Data::Dumper; | |
my %opt; | |
my @opt_desc = qw(length|l=i file|f=s verbose|v); | |
my $getopt = Getopt::Long::Parser->new( | |
config => [qw(gnu_getopt no_ignore_case)] | |
); | |
if ($getopt->getoptions(\%opt, @opt_desc )) { | |
say Dumper({ opt_desc => \@opt_desc, opt => \%opt, argv => \@ARGV}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment