Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: How can I have both short and long options with Getopt::Long?

by 7stud (Deacon)
on Nov 12, 2009 at 16:54 UTC ( [id://806770]=note: print w/replies, xml ) Need Help??


in reply to How can I have both short and long options with Getopt::Long?

How about rolling your own?

use strict; use warnings; use 5.010; my %ok = qw{-v 1 --verbose 1}; my $verbose = ""; for (@ARGV) { $ok{$_} ? $verbose=1 : say "Unknown option: $_"; } say $verbose --output:-- $ perl 1perl.pl -v 1 $ perl 1perl.pl --verbose 1 $ perl 1perl.pl -V Unknown option: -V $ perl 1perl.pl --v Unknown option: --v

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://806770]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-25 20:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found