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;
In reply to Re^2: passing variables between subroutines
by blazar
in thread passing variables between subroutines
by budreaux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |