Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!ccu.umanitoba.ca!rahardj From: rahardj@ccu.umanitoba.ca (Budi Rahardjo) Newsgroups: comp.lang.perl Subject: date-pattern-matching question Keywords: date, pattern matching Message-ID: <1991May27.165523.2644@ccu.umanitoba.ca> Date: 27 May 91 16:55:23 GMT Sender: rahardj@ccu.umanitoba.ca (Budi Rahardjo) Followup-To: comp.lang.perl Organization: University of Manitoba, Winnipeg, Canada Lines: 35 I need advice to perform date pattern matching. Suppose I have the following text file : ----- text.file ---- # userid|name|creator|creation date|expiry date|deletion date # user01|name1|me|date11|date12|date13 user02|joe bloe|someone else|date21|date22|date23 user03|... ... etc. ----- end of text.file ---- I'd like to perform the following queries : - get userid that was created before certain date (or month, or year) - get userid that was supposed to be terminated but not deleted - get userid that has name=x and created before datex - .. etc. ie date-comparison operations 1. How would you store the date ? Which format ? dd-mm-yy dd/mm/yy or integer number (ie # of days since 1980) or even May 27 11:49:31 CDT 1991 2. How would you do the actual pattern matching ? Example needed ... (BTW, the actual database has 50 fields and stored as dbm file). Thanks, budi -- ``A system without PERL is like a hockey game without a fight.'' -- Mitch Wright