{@::cache = (0, 1)} sub fib { {push @::n, shift} {return pop @::n if $::n[-1] < 2} {$::cache [$::n[-1]] ||= fib ($::n[-1] - 1) + fib ($::n[-1] - 2)} {return $::cache[pop @::n]} }
In reply to Re: Programming in Perl without semicolon
by JavaFan
in thread Programming in Perl without semicolon
by buetow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |