in reply to What do you write when learning a new language?
I then write a Fibonacci generator as close to this recursive formula as possible (ignoring the fact that there are better ways to do it):
use strict; for my $i (0 .. 35) { print "i=$i ... fib(i)=", fib($i), "\n"; } sub fib { my $n = shift; return fib($n-1) + fib($n-2) if $n>1; return 1; }
-Paul
|
|---|