Hello vishi,

blue_cowdawg is absolutely correct about asking more questions before starting this task.

So I'm going to give you some thoughts and ideas about how to arrange the data. I once automated a court calendar, and I arranged the data as:

$key = "$date|$time|$court|$judge|$seq"; # $seq allows duplicates ( + "","01",... ) $value = "$case|...";
This work was done in C, and I didn't have the luxury of having Perl to get the project completed. :-(

I used a "key/value" indexed database, and when it came to producing reports, the data was already in the correct order. As each value was entered into the indexed DB, the DB stored the data in the correct order because of the way the key was designed. So if asked to produce the report for a specific court for the next week, it was just set the DB key to the start of the week and reading the DB sequentially until the $date result wasn't part of the week. If you needed a report for a specific judge, you just read the data for the week as above and then use 'split'* to get the $judge and when you find the correct judge, simple add that entry to the report.

Some other thoughts:

Notice that the DB is very much like a Hash, it just the DB can get a lot bigger than the memory you have. To test this without needing a DB, you can use a file and a delimiter between the key and the value. I use chr(254), but any unique unused character will work. Read the file and 'split' on your delimiter to get the key/value for each record and then use 'sort keys %Hash' when reporting or updating the file. To continue to use this without a DB, you can name the files by year, i.e. Cal2013.index, etc.

Now Perl can be as complex as you want, but sometimes a little simplicity goes a long way. But that's part of your decisions in implementing this project.

Good Luck...Ed

* How I wish I had 'split' back then!

"Well done is better than well said." - Benjamin Franklin


In reply to Re: Calendar / Scheduler in Perl by flexvault
in thread Calendar / Scheduler in Perl by vishi

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.