- or download this
# Vacations: day 7 to 14, 20, 22, 25 to 30
#
...
# list entries X X XXXX X X
my @vacation_skip = 7, 15, 20, 21, 22, 23, 25, 31
- or download this
use List::MoreUtils qw/last_index/;
my @vacation_skip = (7, 15, 20, 21, 22, 23, 25, 31);
...
} else {
print "work day\n";
}
- or download this
sub range_overlaps {
my ($start_probe, $end_probe, @skip) = @_;
...
my $end_idx = last_index { $_ <= $end_probe } @skip;
return $start_idx != $end_idx || ($start_idx % 2 == 0);
}
- or download this
my @proxy_vacations = (0, @vacation_skip);
- or download this
sub inverted {
if ($_[0] == 0) {
...
return (0, @_);
}
}
- or download this
# 0 1 2 3 4
# day no. 0123457890123456789012345678901234567890
...
# new range #######
# new vacations ######## ###########
# new markers X X X X
- or download this
my @items = qw/a b c d e/;
my @weights = (0.1, 2, 1, 4, 1.3);
...
}
use Data::Dumper;
print Dumper \@summed_weights;