HTML-Make-Calendar
view release on metacpan or search on metacpan
examples/menu.pl view on Meta::CPAN
#!/home/ben/software/install/bin/perl
use warnings;
use strict;
use utf8;
use FindBin '$Bin';
use HTML::Make::Calendar 'calendar';
binmode STDOUT, ":encoding(utf8)";
my @foods = split '', <<EOF;
ðððððððð¥ððððððð¥ð
ð¥
ð
ð¥ð¥¬ð¥¦ð§ð§
ðð¥ð°ððððððð ð¢
ð£ð¤ð¥ð¥®ð¡ð¥ð¥ ð¥¡ð¦ªð¦ð§ð¨ð©ðªðð°ð§
EOF
@foods = grep {!/\s/} @foods;
my $cal = calendar (cdata => \@foods, dayc => \&add_food);
print $cal->text ();
exit;
sub add_food
{
my ($foods, $date, $element) = @_;
my $today =
$element->push ('span', text => $date->{dom});
my $menu = HTML::Make->new ('ol');
for (1..3) {
my $food = $foods->[int (rand (@$foods))];
$menu->push ('li', text => $food);
}
$element->push ($menu);
}
( run in 0.537 second using v1.01-cache-2.11-cpan-39bf76dae61 )