nysus has asked for the wisdom of the Perl Monks concerning the following question:
My broken example code:
my ($r_array1, $r_array2) = foo(); print "@$r_array1\n"; print "@$r_array2\n"; sub foo { my @array1 = [1..5]; my @array2 = [6..10]; return (\@array1, \@array2); }
The above code results in a printout of the memory locations of the data and not the data itself. TIA!
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar";
$nysus = $PM . $MCF;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Passing references out of subroutines
by Beatnik (Parson) on May 22, 2001 at 21:02 UTC | |
by nysus (Parson) on May 22, 2001 at 21:08 UTC | |
|
Re (tilly) 1: Passing references out of subroutines
by tilly (Archbishop) on May 22, 2001 at 21:07 UTC | |
|
Re: Passing references out of subroutines
by andye (Curate) on May 22, 2001 at 21:20 UTC | |
by davorg (Chancellor) on May 23, 2001 at 14:15 UTC | |
|
Re: Passing references out of subroutines
by princepawn (Parson) on May 22, 2001 at 21:16 UTC |