The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
brassmon_k: there are a few things that you need to do before you should start tackling issues like this. First, good formatting does not indicate good code, but poor formatting almost always indicates bad code. Further, any code over just a few lines needs to have strict and warnings turned on. There are exceptions to that rule, but you need to really apply and understand these rules before you break them. Also, try to factor out common elements in your code and then always, always, always test system calls for failure (in the code above, this is the open statement we're worried about). Applying these rules of thumb to your code and using a split instead of a regex, we get the following:
There are plenty of ways to clean that up from there. As for your original question, check out the Date::Calc module. Hope this helps and Happy New Year! :) Cheers, Join the Perlmonks Setiathome Group or just click on the the link and check out our stats. In reply to (Ovid) Re: Get number ranges from files internally?
by Ovid
|
|