11 lines
208 B
Perl
11 lines
208 B
Perl
|
sub Factorial {
|
||
|
my($n) = @_;
|
||
|
|
||
|
$n <= 2 and return $n;
|
||
|
return $n * Factorial($n-1);
|
||
|
}
|
||
|
|
||
|
for $i (1..9) {
|
||
|
print "$i Factorial =\t", Factorial($i), "\n";
|
||
|
}
|