Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
17 lines (13 sloc) 237 Bytes
#! /usr/bin/perl
use Modern::Perl;
use YAML;
use List::AllUtils qw/ sum /;
sub fibonacci {
state $x = [1,1];
push @$x, sum @$x;
# [1,1, 1 + 1] => [1, 1, 2]
shift @$x;
# [1,2]
}
say fibonacci for 1..15;
for (1..15)
Something went wrong with that request. Please try again.