Oh, sorry. Be sure to pass the array as a ref. Like this.
PRINT_CONTENTS(\@sample_array);
Jordan
On Thu, 2003-02-13 at 15:18, Stephen Spalding wrote:
> Hello all,
>
> I have a question about perl. I'm trying to pass an
> array into a subroutine, but I don't know what the
> proper way to receive it in the subroutine is. Below
> is an example of what I'm trying to do. The ???
> represents what I do not know what to put in.
>
> @sample_array = ('hi', 'there', 'steve');
> &PRINT_CONTENTS("@sample_array");
> exit 0;
>
> sub PRINT_CONTENTS
> {
> @local_array = ???
>
> foreach $string (@local_array)
> {
> print "string = $string\n";
> }
> }
>
> TIA for any help.
>
> -Stephen Spalding
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Shopping - Send Flowers for Valentine's Day
> http://shopping.yahoo.com
Jordan Mclain
http://omega.uta.edu/~jdm6587
817.291.0160
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]