in reply to Re: private recursive subroutines
in thread private recursive subroutines

This approach introduces a cyclic reference with $fac.
use Devel::Cycle; my $fac; $fac = sub { my ( $n ) = @_; return 1 if $n == 1; return $n * $fac->( $n - 1 ); }; find_cycle($fac); __END__ Cycle (1): $A variable $fac => \&A

blokhead

Replies are listed 'Best First'.
Re^3: private recursive subroutines
by Sixtease (Friar) on May 10, 2007 at 21:10 UTC
    I can't say I understand much how the cycle gets introduced. Anyway, does undef $fac after the usage solve it?