{ my ($end, $result, $_fact); $_fact = sub { $end ? ($result *= $end-- and &$_fact) : $result } sub fact { ($end, $result) = (shift, 1); &$_fact } }