I want to create an HTML calendar, whose dates will be links to dated files found in a particular directory. I figured that I could use
HTML::CalendarMonthSimple to do this.
I'd like to run this script out of cron nightly to generate the calendars.
I'm sure that it's my lack of experience, but I can't quite see how to accomplish this. Should I be using a different module? Here's what I thought should work:
#!/usr/local/bin/perl -w
use HTML::CalendarMonthSimple;
use strict;
use vars qw($cal $file $date $mm $dd $yyyy);
while (my $line = <DATA >) {
chomp $line;
($file, $date) = split('\.', $line);
$mm = substr($date,4,2);
$dd = substr($date,6,2);
$yyyy = substr($date,0,4);
$cal = new HTML::CalendarMonthSimple('month'=>$mm,'year'=>$yyyy);
$cal->setdatehref($dd, "/home/trixee/cal.txt",);
}
print $cal->as_HTML();
__DATA__
file1.20020801
file2.20020802
file3.20020803
In the example above, $dd never gets interpolated(term.?), although $yyyy and $mm do. I figured that someone here could easily point me in the right direction.
TIA,
Trixee
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.