in reply to Could I get some feedback on my code please?
I'm in a very similar boat to yourself. I'm not able to run your code but just from reading it I think it looks fine. And if it works that surely must be a bonus. :-)
I would like to make a few points and ask a couple of questions.
The list of 23 regexes in fetchArticleCreator() to extract data from HTML could be replaced by using an HTML parser.
To add to f00li5h's very good point about taking the HTML 'guff' out of your script. You don't appear to be using CGI.pm for any output. I don't either so I moved over to using CGI::Simple. The docs discuss why you might consider doing the same.
Minor nits.
I find using all uppercase for globals helps make my scripts clearer. Why do you "our" instead of "my"?
imo I think CGI scripts in particular benefit from the 3 argument open. I also always use a lexical file handle to avoid the bareword.
For my own curiosity:
Why do your subs checkForUnexpectedArgs()? All the subs are called from within the script so I'm not sure how useful the user will find that message.
When would checkFileCanBeAccessed() return and a subsequent open die? Wouldn't or error("$msg $!") on the open be enough? I have some major rewriting to do if it isn't. :-)
Hope that helps.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Could I get some feedback on my code please?
by PockMonk (Beadle) on Jan 13, 2007 at 11:49 UTC |