Hi, Shaun, :) > I currently currently passing a subroutine one scalar value and two > arrays.
Hmm. This is not what you're doing in the example code. In the example code, this line: subroutine($a, @array1, @array2); says "Call subroutine with arguments of $a, all of the entries in @array1, and all of the entries in @array2." The contents of @array1 and @array2 are unwound and stuck into a big list along with $a to make up the arguments to &subroutine. > Both array's work before and after the function call. However only one of > hte arrays works within the subroutine. I'd be very surprised if anything works at all in the example you show here. If you want to truly pass in two arrays, you'll have to pass the arrays by reference, like so: subroutine( $a, \@array1, \@array2 ); The '\@array1' notation means to create an anonymous reference to @array1. And the 'subroutine' definition looks like: sub subroutine { my ($a, $array1_r, $array2_r) = @_; print @$array1_r; print @$array2_r; } When you dereference the references, you have to explicitly tell perl that the references point to arrays, hence the "@$array1_r" notation. Take a look at "references" in the Camel book. > It is always the same array that is not being passed. Even if I switch > @array1 and @array2 I still will only get one useable array within the > subroutine. In your example, when perl constructs the argument list for 'subroutine', all of the independence of @array1 and @array2 are lost. Arrays, however, are individual scalars that you pass around. BTW, I'm stumped that you even got access to @array1 in your code. Are you using 'warnings' and 'strict'? You *should* be. Perl doesn't have named parameters liked C. You can declare a prototype for a subroutine, but you can't give the parameters named. You "name" parameters by providing names to the items in the argument list, as in my example above ('my ($a,...) = @_;'). ---Jason Sonos Handbell Ensemble Perl newbie; having fun... P.S. - Forget I said anything about prototypes - neither you nor I will probably ever need them. ***************************** This communication may contain information that is proprietary, privileged, confidential or legally exempt from disclosure. If you are not a named addressee, you are notified that you are not authorized to read, print, retain, copy or disseminate this communication without the consent of the sender and that doing so may be unlawful. If you have received this communication in error, please notify the sender via return e-mail and delete it from your computer. Thank you. St. Jude Medical, Inc. ***************************** -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]