in reply to Passing different values into subroutines
You can use references to pass hashes as well, you can even pass subroutines if you feel like it.my @array1 = ( 1, 2, 3, 4 ); my @array2 = ( 5, 6, 7, 9 ); printArrays( \@array1, \@array2 ); sub printArrays { my ( $first, $second ) = @_; print "@$first @$second\n"; }
That should be what you want to do... untested...sub printEachExpt { my ( $expNames, $outputPath ) = @_; my $total = @$expNames; print "The output path is $outputPath.\n"; print "The experiment files are:\n"; for ( 0 .. $#$expNames ) { print "$outputPath/$expNames->[$n]\n"; } return( $expNames, $outputPath); }
|
---|
Replies are listed 'Best First'. | |
---|---|
RE: RE: Passing different values into subroutines
by Adam (Vicar) on Aug 31, 2000 at 21:48 UTC |