in reply to Passing references out of subroutines

That's because you're actually creating references to references to arrays with my @array1 = [1..5];...
try :
($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); }

Update: while we're recommending books on the subject... Damian Conway's Object Orientated Perl is really one of my favorites...

Greetz
Beatnik
... Quidquid perl dictum sit, altum viditur.

Replies are listed 'Best First'.
Re: Re: Passing references out of subroutines
by nysus (Parson) on May 22, 2001 at 21:08 UTC
    Ha! I'm a dummy...got referencing on the brain and confusing it with how to create an array! Thanks!

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar";
    $nysus = $PM . $MCF;