Harry Putnam wrote:

What I'm working on will eventually be a script that reads an `events'
file and lets me know about events I've entered there.  It's my own
primitive but hopefully effective calendar reminder type of tool.

The format of entries look like this:

cat ~/.events

  ev 100411 4
    Wash behind ears
  ev

  ev 100421 4
    Avoid a beating by taking out the garbage
    this evening.
  ev

 [...]

The multidigit numbers represents YYMMDD,

If we have learned anything from Y2K it is that you should always use four digits for the year.


My script will read this file (from cron).  It has to get a year mnth
and mday out of there.

$ perl -le'
my ( $year, $mnth, $mday ) = "100421" =~ /(\d\d)(\d\d)(\d\d)/;
print "Year = $year, Month = $mnth, Day = $mday"
'
Year = 10, Month = 04, Day = 21


 That date will be converted to epochal for
comparing with current date. (I think I've got that part worked out)



John
--
The programmer is fighting against the two most
destructive forces in the universe: entropy and
human stupidity.               -- Damian Conway

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to