in reply to Re^11: sub fuction inside sub functioin?
in thread sub fuction inside sub functioin?

I was talking about
{ my $inner; sub outer { $inner=sub { ... $inner->(); ... } } }.
OK I just saw your update. IMHO this is the safest way to realize inner subs without stash side-effects and cyclic memory leaks.

To get back to the OT, I recommend it this way.

Cheers Rolf

Replies are listed 'Best First'.
Re^13: sub fuction inside sub functioin?
by ikegami (Patriarch) on Dec 08, 2008 at 17:08 UTC

    To get back to the OT, I recommend it this way.

    To get back to the OT, I stick with my original recommendation. I had already considered the alternatives before posting it and found them to leak memory and/or needlessly convoluted.

    Reader, take your pick. If you bless a hash to make an object, you have no reason to use lexicals for inner subs.