summaryrefslogtreecommitdiff
path: root/ruby_1_9_3/benchmark/other-lang/fact.pl
blob: a9b0b69cdf20b8cbb7a31a2cc8cde3a9730b61ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
sub fact{
  my $n = @_[0];
  if($n < 2){
    return 1;
  }
  else{
    return $n * fact($n-1);
  }
}

for($i=0; $i<10000; $i++){
  &fact(100);
}