ginju75 has asked for the wisdom of the Perl Monks concerning the following question:
Hello Wise Monks,
Is there a way a subroutine can return 2 individual arrays at the same time.
How can I do the following? (If at all I can do it?)
my @array = &xsubroutine(); my @mainarray1 = shift @array; my @mainarray2 = shift @array; sub xsubroutine{ my (@array1, @array2) yada; yada; psuh (@array1, $_); yada; yada; push(@array2, $_); }
At this point I want the subroutine to Return both the arrays (array1 and array2) to the "main" for furthur use as shown. Can I even do this?
Thank you all for the help.
ALM (A Learning Monk)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Returning two arrays..
by tstock (Curate) on Jan 04, 2002 at 09:14 UTC | |
|
Re: Returning two arrays..
by impossiblerobot (Deacon) on Jan 04, 2002 at 07:23 UTC | |
|
Re: Returning two arrays..
by count0 (Friar) on Jan 04, 2002 at 20:57 UTC | |
by Takophiliac (Novice) on Feb 16, 2005 at 20:14 UTC | |
|
Re: Returning two arrays..
by metadoktor (Hermit) on Jan 04, 2002 at 16:42 UTC | |
by davorg (Chancellor) on Jan 04, 2002 at 17:18 UTC |