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

Re: Getopt::Long subroutine question

by Loops (Curate)
on Jul 22, 2013 at 21:27 UTC ( #1045730=note: print w/replies, xml ) Need Help??


in reply to Getopt::Long subroutine question

You can't use a sub reference like that if your desire is for it to receive all the parameters at once. Here is an alternative:

use strict; use warnings; use Getopt::Long; my @test; GetOptions( 'test=s{3}' => \@test ); sub sub1 { print "@_" }; sub1 @test if @test;

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1045730]
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (4)
As of 2016-12-08 04:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (135 votes). Check out past polls.