in reply to Re: passing variables between subroutines
in thread passing variables between subroutines
you pull them off the @_ array you can shift them off the array individually or assign them in one shot as shown above. <edit> alternatively, if you have only one parameter you can do the following my $param_one = shift @_</edit>
As bunnyman correctly pointed out there's no real difference between the case of one and of many parameters respectively. What is to be said here is that:
even thoughmy $self=shift; my ($foo, $bar, $baz)=@_;
my ($self $foo, $bar, $baz)=@_; # would be just as fine.
my $param_one=shift;
|
|---|