sub date_list { my ( $from, $to ) = @_; my @dates = $from; my $intermediate = $from; while ( $intermediate ne $to ) { $intermediate = sprintf "%04d-%02d-%02d", Add_Delta_Days( spli +t( /-/, $intermediate ), 1 ); push @dates, $intermediate; } my $first = shift(@dates); my $last = pop(@dates); return map { ($_) x 10 } @dates; }
Outputs for me using 2014-01-02 and 2014-01-06:
2014-01-03 2014-01-03 2014-01-03 2014-01-03 2014-01-03 2014-01-03 2014-01-03 2014-01-03 2014-01-03 2014-01-03 2014-01-04 2014-01-04 2014-01-04 2014-01-04 2014-01-04 2014-01-04 2014-01-04 2014-01-04 2014-01-04 2014-01-04 2014-01-05 2014-01-05 2014-01-05 2014-01-05 2014-01-05 2014-01-05 2014-01-05 2014-01-05 2014-01-05 2014-01-05
In reply to Re: Generate list with array elements repeated x times
by toolic
in thread Generate list with array elements repeated x times
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |