]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blob - doc/plugins/write/tutorial/discussion.mdwn
ikiwiki (3.20140916) unstable; urgency=low
[git.ikiwiki.info.git] / doc / plugins / write / tutorial / discussion.mdwn
1 Thanks for the tutorial!
3 But I think you have an error in the fib function! If you really start with
5     my $last = 0;
7 and your fib function, you'll get this error, as you've produced a never ending recursion:
9     Deep recursion on subroutine "IkiWiki::Plugin::fib::fib" at ./fib.pm line 29.
11 So the fib function should better look like this, which is its true definition (see [[Wikipedia|http://de.wikipedia.org/wiki/Fibonacci-Folge]], for example):
13         sub fib {
14                 my $num=shift;
15                 return 0 if $num == 0;
16                 return 1 if $num == 1;
17                 return fib($num - 1) + fib($num - 2);
18         }
20 Just as a hint for people who run into this error while doing this tutorial.