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;
In reply to Re: Getopt::Long subroutine question
by Loops
in thread Getopt::Long subroutine question
by brassbin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |