This ought to give you are start. Managing recuring calendar events and check out this code, written by someone else(unknown). All you need to do is figure out a hash, to link dates(as keys), with those days appointments(1..24 hours). So a hash of hashes might do it.

A GUI calendar with Tk or Gtk2 would be alot easier than commandline. Or by commandline, do you mean "not html or cgi" ?

If you can use Tk or Gtk2 (GUI's), look at Tk::MiniCalendar or Tk::ChooseDate. GUI's are easier, because you can let the user mouse click on a date from a calendar, pop up an text box, and let him enter the appointment and time. Perl/Gtk2 has a 'Calendar' widget too. See Gtk2 Simple Calendar/ Date Selector

If you are stuck with a true "commandline" program, you will need to work out a system, where you take user input, prompt for times and text, and do all sorts of prompting and confirming input.

#!/usr/bin/perl -w use strict; use Date::Calc qw(Calendar); #usage cal monthnum yesr; i.e. cal 8 2002 for AUG2002 #defaults to current month my $month = shift || (localtime(time))[4]+ 1; #numeric for subroutine my $year = shift || (localtime(time))[5] +1900; my @cal = parseCalendar(); my @months = (undef,'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'); $month = $months[$month]; #change $month to 3-letter abbreviation print "\n$month$year: ",'Mo Tu We Th Fr Sa Su',"\n"; my $i = 1; foreach my $cal_line (@cal) { print " Week",$i++,": "; foreach my $day (@$cal_line) { $day ||= " "; print "$day "; }print "\n"; }print "\n"; exit; ##################################################################### sub parseCalendar { my $cal = Calendar($year, $month); my @cal = split(/\n/, $cal); splice(@cal, 0, 3); # get rid of the first three lines (don't need em) +; my @rv = map{$_ = substr($_, 1, length);[split /\s{4}|\s{2}/];}@cal; return @rv; }

I'm not really a human, but I play one on earth. Cogito ergo sum a bum

In reply to Re: A calendar tool (command-line version) by zentara
in thread A calendar tool (command-line version) by osssss

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.