in reply to It does exactly the opposite of what I want it to!

I don't know if this has anything to do with it, but I highly doubt that return \@returnLink, \@returnDir; is going to accomplish much, since the referenced arrays are local to the subroutine that's returning. I believe you're just going to be left with dangling pointers.

Update: Okay, evidently Perl actually allows this (preserving data structures until all references to them are gone), but it still rubs me as bad style. That's what I get for learning C.

--isotope