Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: Questions about Recursion and "Extract your transversal", by chromatic

by mascip (Pilgrim)
on Jun 07, 2013 at 07:56 UTC ( #1037616=note: print w/ replies, xml ) Need Help??


in reply to Re: Questions about Recursion and "Extract your transversal", by chromatic
in thread Questions about Recursion and "Extract your transversal", by chromatic

Thank you. Now i understand the 2 sources of circularity in the original solution. With my solution they would be gone, as we would be using named subroutines instead of references to a subroutine. Thus, using get_all_text_in() in the hash won't create any leak.

I can now add in the list of pros and cons above:

  • + no risk of inducing a memory leak

I guess here that personal preferences will differ.Personally i would go for the "named subroutines" solution, because i can spot recursion errors more easily than memory leaks. And because i like simple logic.

I am interested to hear people's reasons for preferring one or the other.


Comment on Re^2: Questions about Recursion and "Extract your transversal", by chromatic
Replies are listed 'Best First'.
Re^3: Questions about Recursion and "Extract your transversal", by chromatic
by mascip (Pilgrim) on Jun 10, 2013 at 17:13 UTC

    In fact, the solution with __SUB__ could use a named subroutine, in which case there's no more memory leak risk. Is that right?

    We are then left with the pros and cons that i outlined in my first message. And i don't know which i would prefer.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1037616]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (11)
As of 2015-07-31 21:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (282 votes), past polls