- or download this
my @even = 0, 2, 4 ... { $_ + 2};
my @powers = 1, 2, 4 ... { $_ * 2 };
my @fib = 1, 1, 2 ... { $^a + $^b};
- or download this
my @ints = 1, 2, 3, 4 ... *;
my @even = 0, 2, 4, 6 ... *;
my @powers = 1, 2, 4, 8 ... *;
- or download this
1, 3, 5 ... * # odd numbers
1, 2, 4 ... * # powers of 2
- or download this
sub series(@items, $recursion_level = 2) {
return if $recursion_level < 0;
...
# give up
return;
}
- or download this
use List::MoreUtils qw(all);
sub series {
...
return;
}
- or download this
#!/usr/bin/perl
use strict;
...
$result = 'undef' unless defined $result;
is $result, $expected, "seq " . join(', ', @{$t->[0]});
}