Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    }
    my $iterator = fibonacci();
    print $iterator->(), $/ for 1 .. 20;
    
  2. or download this
    sub fibonacci {
        my $fib = shift;
    ...
    }
    
    print fibonacci(0), $/;
    
  3. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
    }
    
    print fibonacci(20), $/;