in reply to Pulling by regex II

BrowserUk, I decided against using Date:Manip even though I really like that module. That's because the module instructions warn that it's slower than other time modules and this script will be used most often when the web server is overloaded with requests; thus, speed is essential.

Given you are doing a filesystem read between every call to Date::Manip, I seriously doubt it would be a bottleneck. In any case it would be running faster than your broken code:).

If you really find that Date::Manip is too slow for your application, then you could move to using one of the (several dozen) Date::* modules on CPAN rather than attempting to roll your own. Several of these are mentioned in the Date::Manip pod: Date::Parser, Date::Calc. The later of which is an interface to a C library I believe and its reputedly very fast. The main reason I didn't suggest these is that you need to compile them which is sometimes a problem.

A quick look at your code and its glaringly obvious what the problem is. And if you hadn't commented out the use strict and omitted the -w/use warnings it would be glaringly obvious to you too, as the compiler would be screaming the cause at you over and over. 11 times I think.

Come back, if you need to, once you have made your code compile cleanly with -w and use strict and you might get some further help.


Examine what is said, not who speaks.

Replies are listed 'Best First'.
Re: Re: Pulling by regex II
by mkent (Acolyte) on Dec 14, 2002 at 23:10 UTC
    I'm really sorry if I offended you. That wasn't my intention at all and I really appreciate the help. I was reluctant to install Date::Manip, being new to this stuff, but I've done it and now I'm trying to figure out where to specify the log files on my server to test your code. Again, thanks and I didn't mean to offend you.