http://qs321.pair.com?node_id=541740


in reply to recursive anonymous subroutines

Maybe you'd be interested in the Y combinator.
#!/usr/bin/perl -w use strict; print "5! = ", Y(sub{ my ($proc, $n) = @_; ($n < 2) ? 1 : $n * $proc->($proc,$n-1) }, 5), "\n"; sub Y { my ($p, $x) = @_; $p->($p,$x); }