in reply to Recieving lists as arguments
To illustrate:
To assign the entire argument list you would have to code the sub-routine like this:@foo = (1,2,3); process_array(@foo); sub process_array { # the special @_ variable now holds (1,2,3), NOT (@foo) $var1 = shift; # $var1 will only get '1'. $var2 = shift; # $var2 will only get '2'. $var3 = shift; # $var3 will only get '3'. }
or using an array reference:sub process_array { @args = @_; }
Hope that helps.sub process_array { $args = \@_; }
Amel - f.k.a. - kel
|
|---|