in reply to How to return the two set of arrays to the main program at the same time ??

There's another way noone mentioned:

calculate(\@array1, \@array2, 10, 20, 30); sub calculate { my ($array1, $array2, $i, $j, $k) = @_; @$array1 = (); @$array2 = (); $array1->[0] = $i + $j; $array1->[1] = $i - $j; $array1->[2] = $i * $k; $array2->[0] = $j + $k; $array2->[1] = $j - $k; }

Note: $a and $b shouldn't be used as variable names. They conflict with special variables.

  • Comment on Re: How to return the two set of arrays to the main program at the same time ??
  • Download Code