On 10/12/2006 11:23 AM, Moon, John wrote:
-Original Message-
From: Gallagher, Tim F (NE) [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 12, 2006 11:55 AM
To: Perl Beginners
Subject: Subroutine returning 2 arrays
From a subroutine I would like to return 2 separate arrays like this
Believe you want to do as a reference otherwise it justs returns the
data as a flat file or stream of data.
Here is a snippet. Would get away from a and b since the $a and $b are
used by sort. Know that it is an array, but would get away from that.
Also use strict and warnings.
#!perl
use strict
-Original Message-
From: Gallagher, Tim F (NE) [mailto:[EMAIL PROTECTED]
Sent: Thursday, October 12, 2006 11:55 AM
To: Perl Beginners
Subject: Subroutine returning 2 arrays
>From a subroutine I would like to return 2 separate arrays like this
sub TEST
{
@a = ("a1","a2","a3","a4","a5","
On 10/12/2006 10:55 AM, Gallagher, Tim F (NE) wrote:
From a subroutine I would like to return 2 separate arrays like this
sub TEST
{
@a = ("a1","a2","a3","a4","a5","a6","a7");
@b = ("b1","b2","b3","b4","b5","b6","b7");
return (@a, @b);
}
my(@lala,@baba) = TEST;
print @lala;
The probl
Thank you.
Tim
-Original Message-
From: Wagner, David --- Senior Programmer Analyst --- WGO
[mailto:[EMAIL PROTECTED]
Sent: Thursday, October 12, 2006 12:09 PM
To: Gallagher, Tim F (NE); Perl Beginners
Subject: RE: Subroutine returning 2 arrays
Believe you want to do as a