sub fac { $n = shift; if($n==0) { return 1; } else #otherwise { return $n*fac($n-1); } }