August 1999 Perl Hardware Store Slide #25

Highly Recursive Functions

         # Compute nth Fibonacci number
         sub fib {       
           my $n = shift;
           if ($n < 2) { $n } 
           else        { fib($n-1) + fib($n-2) }
         }


Next Copyright © 1998 M-J. Dominus