in reply to Using Shift with Parameters in a subroutine
. Generally speaking, if you have 10 parameters, and you call mysub(1,2,3,4,5,6,7..10), you can take the parameters in various wayssub foo { my ($query_ref, $session_ref) = @_; }
sub mysub { my a = shift; #1 my $b = shift; #2 ... and so on
and in your casesub mysub { my @p = @_; #the array 1,2,3....10 ...
I hope you help.sub mysub { my ($a, $b, $c, ....$j) = @_; #$a = 1, $b = 2, ... $j = 10
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using Shift with Parameters in a subroutine
by perlron (Pilgrim) on Oct 20, 2014 at 12:08 UTC |