--- louie miranda <[EMAIL PROTECTED]> wrote: > Hi, im really clueless.. > > #!/usr/bin/perl > > $logfile = '/etc/services'; > $date = 'date'; > > open(INFO, $logfile); > @lines = <INFO>; > close(INFO); > print @lines; > > All i have is this line of code.. > what i want to make is, > > ex: > the perl script will parse a file and match the cur date. > > how can i do that? any help will do, ty.
I assume that dates are embedded in the lines of /etc/services. What is the format of the dates? To get the current day of month, month, and year, you can use this: my ( $day_of_month, $month, $year ) = ( localtime )[ 3 .. 5 ]; With that information, it should be relatively easy to match it up to the date format in the file. If you post a few sample lines from /etc/services with the date format, that would help. Cheers, Curtis "Ovid" Poe ===== Senior Programmer Onsite! Technology (http://www.onsitetech.com/) "Ovid" on http://www.perlmonks.org/ __________________________________________________ Do You Yahoo!? Buy the perfect holiday gifts at Yahoo! Shopping. http://shopping.yahoo.com -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]