in reply to Returning more than two arrays to the subroutine

which is also giving some memory errors
What errors?

How do you populate @nodes? Maybe the following line is missing after the call to get_node:

my @nodes = @$nodelist;
لսႽ† ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ