Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Trickery with Getopt::Long (flag option, with optional integer arg)

by toolic (Bishop)
on Aug 18, 2017 at 15:12 UTC ( #1197614=note: print w/replies, xml ) Need Help??


in reply to Trickery with Getopt::Long (flag option, with optional integer arg)

Use the :i specifier. Refer to Summary of Option Specifications.
use warnings; use strict; use Getopt::Long; my $arg = -1; GetOptions('arg:i' => \$arg) or die; print "$arg\n";

Replies are listed 'Best First'.
Re^2: Trickery with Getopt::Long (flag option, with optional integer arg)
by stevieb (Canon) on Aug 18, 2017 at 15:14 UTC

    That's great and works exactly as I need, thanks toolic!

    I completely overlooked that in the docs. I was kind of thinking there had to be a way.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2022-01-22 17:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In 2022, my preferred method to securely store passwords is:












    Results (63 votes). Check out past polls.

    Notices?