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