Loading ...
Sorry, an error occurred while loading the content.

RE: [PBML] Functions and Arrays

Expand Messages
  • Jonathan Dunn
    On Mon, 2 Jun 2003 13:23:34 -0400, Kipp, James wrote ... Or to minimize dealing with the refs, just deref inside the sub: yoursub( @array1, @array2); sub
    Message 1 of 3 , Jun 2, 2003
    • 0 Attachment
      On Mon, 2 Jun 2003 13:23:34 -0400, Kipp, James wrote
      > pass them as references. goes like this:
      > yoursub(\@arref, \@arref2);
      >
      > sub getem {
      > my ($aref) = shift;
      > my ($aref2) = shift;
      > #..deref them and do stuff
      > for $i (@$aref) { .... }
      > # or whatever you need to do with them
      > }

      Or to minimize dealing with the refs, just deref inside the sub:

      yoursub(\@array1, \@array2);

      sub yoursub {
      my( $ref1, $ref2 ) = @_ ;
      my @array1 = @{$ref1} ;
      my @array2 = @{$ref2} ;
      #now use arrays as before
      }
    Your message has been successfully submitted and would be delivered to recipients shortly.