Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^4: GetOpt::Long usage style

by demerphq (Chancellor)
on Apr 11, 2016 at 17:22 UTC ( #1160140=note: print w/replies, xml ) Need Help??


in reply to Re^3: GetOpt::Long usage style
in thread GetOpt::Long usage style

Besides what tye said in Re^4: GetOpt::Long usage style (\my @a), you can just use an arrayref instead. Obviously the reference operator \ required for scalars can be omitted.

'multi=s' => (my $multi = [1..3]),

Same for a hash/hashref. Admittedly it is not quite the same as what one would expect from

'multi=s' => (\my @multi = (1..3)),

Which throws an error, which I think is arguably an error in Perl.

BTW, sorry it took me so long to reply, and thanks for adding your point.

---
$world=~s/war/peace/g

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (5)
As of 2020-09-24 12:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (133 votes). Check out past polls.

    Notices?