fact(4) = 4 * 3 * 2 * 1 = 24 #### $ perl -e ' sub fact { my $c = shift; my $result = 1; $result *= $_ for 1..$c; return $result;} print fact (shift);' 10 3628800 #### fact(1) = 1 fact (n) = n * fact (n-1) #### $ perl -e ' sub fact { my $c = shift; return 1 if $c == 1; $c * fact($c-1); } print fact (shift);' 10 3628800