in reply to Re: Passing a list as a subroutine's return value ( list of HTML::Element objects )
in thread Passing a list as a subroutine's return value ( list of HTML::Element objects )

Thanks.

How can one tell when a 'new' variable is somehow connected to another?

  • Comment on Re^2: Passing a list as a subroutine's return value ( list of HTML::Element objects )

Replies are listed 'Best First'.
Re^3: Passing a list as a subroutine's return value ( list of HTML::Element objects )
by ikegami (Patriarch) on Sep 27, 2023 at 14:01 UTC

    In general, you don't have to worry about that. As long as you hold a reference, the object will be kept alive. But you called a function which frees the tree including all of its nodes, which it does by hollowing out any existing references to its nodes.