NAME FML::Demo::Calendar - show a calendar (demonstration module). SYNOPSIS use FML::Demo::Calendar; my $schedule = new FML::Demo::Calendar; $schedule->parse; # show table by w3m :-) my $tmp = $schedule->tmpfilepath; my $fh = new FileHandle $tmp, "w"; if (defined $wh) { $schedule->print($fh); $fh->close; } system "w3m -dump $tmp"; unlink $tmp if -f $tmp; DESCRIPTION "CAUTION:" This module is created just for a demonstration to show how to write a module intended for your personal use. This module is not enough mature nor secure. This is also a demonstration module to show how to use and build up modules to couple with CPAN and FML modules. For exaple, this routine uses "HTML::CalendarMonthSimple" under cpan/lib. It parses files in ~/.schedule/ and output the schedule of this month as HTML TABLE by default. To see it, you need a WWW browser e.g. "w3m". FILES in ~/.schedule/ Theare are arbitrary number of files. This module treis to parse all files here and use only valid entries found in them. The file format follows: # comment: the format is /^(\d+\/\d+)\s+(.*)/ or /^(*\/\d+)\s+(.*)/ DATE CONTENT DATE CONTENT FORMAT IS ARBITORARY where null lines or space lines are ignored. # the first day! 01/01 shougatu yasumi # 20 of each month */20 doctor. METHODS new($args) Constructor. It speculates "user" by $args->{ user } or $ENV{'USER'} or UID and determines the path for ~user/.schedule/. $args can take the following variables: $args = { schedule_dir => DIR, schedule_file => FILE, mode => MODE, }; "CAUTION:" The string for ~user is restricted to ^[-\w\d\.\/_]+$. PATH is reset at the last of new() method. tmpfilepath($args) return a tmpfile path name, which is under ~/.schedule directory. It creates just a file path not file itself. parse($args) Parse files in ~/.schedule/ or the specified schedule file. print_as_html($fd) print out the result as HTML. You can specify the output channel by file descriptor $fd. print_specific_month($fh, $month, $year) print range specified by $month and $year. $month is a number or string among "this", "next" and "last". MODE get_mode( ) show mode (string). set_mode( $mode ) override mode. The mode is either of 'text' or 'html'. XXX: The mode is not used in this module itsef. This is a pragma for other module use. CODING STYLE See "http://www.fml.org/software/FNF/" on fml coding style guide. AUTHOR Ken'chi Fukamachi COPYRIGHT Copyright (C) 2004,2005,2006 Ken'chi Fukamachi All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. HISTORY FML::Demo::Calendar first appeared in fml8 mailing list driver package. See "http://www.fml.org/" for more details. Firstly this module name is "TinyScheduler.pm" and renamed to Calendar::Lite later. In 2004, it is renamed to FML::Demo::Calendar again since this module must depend FML::* classes.