Update: Added unshift and push to make sure first and last rows have seven days.#! /usr/bin/perl use strict ; use warnings ; $|++ ; use Date::Calc qw( Calendar ) ; use Data::Dumper ; my $cal = Calendar( 2002, 8 ) ; my @arr = map { [ split ] } grep { /^[\d\s]+$/ } split /\n/, $cal ; unshift @{$arr[ 0]}, undef until @{$arr[ 0]} == 7 ; push @{$arr[-1]}, undef until @{$arr[-1]} == 7 ; print Dumper( \@arr ) ; __END__
Those who know that they are profound strive for clarity. Those who
would like to seem profound to the crowd strive for obscurity.
--Friedrich Nietzsche
In reply to Re: Easier way to cram Date::Calc's Calendar into a 2-D array
by DamnDirtyApe
in thread Easier way to cram Date::Calc's Calendar into a 2-D array
by oylee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |