[ABE.pm] returning an array from a subroutine

Faber Fedor faber at linuxnj.com
Fri Mar 4 18:50:23 PST 2005


How to do it?


I've got a sub routine that creates an array (it could be sizeable but
I'll worry about that later).  I've tried every permutation I can think
of to return the array to the calling function:

    @my_array = foobar() and in the func do a "return @another_array"
    foobar(@myarray) and populating it inside the func 
    foobar(\@myArray) and populating it inside the func

The only thing I can think of doing now is to flatten the array into a
string.  I can't believe that's how it's suppposed to be done.

-- 
 
Regards,
 
Faber                     

Linux New Jersey: Open Source Solutions for New Jersey
http://www.linuxnj.com





More information about the ABE-pm mailing list