Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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;


Comment on Re: Getopt::Long subroutine question
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (8)
As of 2015-07-06 09:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (71 votes), past polls