Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 taking refuge in the Monastery: (4)
As of 2015-01-31 01:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My top resolution in 2015 is:

















    Results (255 votes), past polls