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

Re: Getopt::Long subroutine question

by Loops (Hermit)
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 wandering the Monastery: (5)
As of 2014-09-19 04:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (129 votes), past polls