in reply to Returning two arrays..
#!/usr/local/bin/perl -w
use strict;
my ($f1,$f2,$f3)=foo();
print "arry1 arry2 arry3\n";
print "----- ----- -----\n";
for my $i (0..(scalar(@$f1)-1))
{
print " @$f1[$i] @$f2[$i] @$f3[$i]\n";
}
sub foo
{
my @$arry1=("a1","a2","a3");
my @$arry2=("b1","b2","b3");
my @$arry3=("c1","c2","c3");
return @_=($arry1,$arry2,$arry3);
}
Should print out the following:
arry1 arry2 arry3 ----- ----- ----- a1 b1 c1 a2 b2 c2 a3 b3 c3metadoktor
"The doktor is in."
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Returning two arrays..
by davorg (Chancellor) on Jan 04, 2002 at 17:18 UTC |