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:

  1. shift is customary when passing just one parameter or when "singling" out one, e.g. typically in OO:
    my $self=shift; my ($foo, $bar, $baz)=@_;
    even though
    my ($self $foo, $bar, $baz)=@_; # would be just as fine.
  2. @_ is the implicit topic of shift, so, while you generally shift @an_array, the common and recommendable idiom here is
    my $param_one=shift;