Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight
 
PerlMonks  

Re: private recursive subroutines

by naikonta (Curate)
on May 10, 2007 at 15:36 UTC ( [id://614660]=note: print w/replies, xml ) Need Help??


in reply to private recursive subroutines

Interesting. How would you escape from the recursive? Or, could you please give a real example of usage?

Open source softwares? Share and enjoy. Make profit from them if you can. Yet, share and enjoy!

Replies are listed 'Best First'.
Re^2: private recursive subroutines
by gaal (Parson) on May 10, 2007 at 16:03 UTC
    There's one here. Look for the comment saying "yay for recursive closures" :-)
Re^2: private recursive subroutines
by Sixtease (Friar) on May 10, 2007 at 16:04 UTC

    I don't think that showing my real-world example would have much point. I just had a very complicated subroutine where I wanted to refactor some code to a separate sub. I didn't want to pollute the package's namespace with another function name, so I used a my $coderef. And it turned out to be a good task for recursion, so here we go.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-04-19 04:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found