in reply to Passing arrays

There are many things you could be encountering, since you didn't post any code we will have to consult the oracle to determine what the nature of your problem is:

The oracle says: "Lightning strikes."

# store the array in a variable my @foo = builder(); # pass it to another function to print the contents printer(@foo); # build array of arrays (sic) and return it sub builder { my @built = ( [qw/a b c d e f g/], [qw/1 2 3 4 5 6 7/], ); return @built; } # print the data sub printer { my @array = @_; foreach(@array) { print join(' ',@{$_})."\n"; } } __DATA__ a b c d e f g 1 2 3 4 5 6 7

Replies are listed 'Best First'.
Re: Re: Passing arrays
by jjohhn (Scribe) on Mar 10, 2003 at 19:15 UTC
    In the interest of TMTOWTDI and as a newbie as well, I also like this approach for displaying without the join:
    # print the data sub printer { my @array = @_; foreach(@array) { print "@{$_}\n"; } }