summaryrefslogtreecommitdiff
path: root/jni/ruby/benchmark/other-lang/fib.pl
blob: a46f666d1e0de4ef379944c76b0bde1451074d76 (plain)
1
2
3
4
5
6
7
8
9
10
11
sub fib{
  my $n = $_[0];
  if($n < 3){
    return 1;
  }
  else{
    return fib($n-1) + fib($n-2);
  }
};

&fib(34);