in reply to Returning more than two arrays to the subroutine
which is also giving some memory errors
How do you populate @nodes? Maybe the following line is missing after the call to get_node:
my @nodes = @$nodelist; [download]