Thanks for the response, lots to get my teeth into there:

The list of 23 regexes in fetchArticleCreator() to extract data from HTML could be replaced by using an HTML parser.

Could you explain this in more detail please?

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

I've just revised the script to take account of HTML::Template as suggested, I should look into CGI::Simple shortly as advised.

I find using all uppercase for globals helps make my scripts clearer. Why do you "our" instead of "my"?

I'm guessing probably because I don't truly understand globalsand aren't using them properly! :-P

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

Thanks, I'll look into that on the link provided.

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

The script isn't complete yet and I find it helpful while debugging etc to catch anything I've passed accidentally when I'm chopping and changing what gets passed to what.

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. :-)

I'm sure that you're right, actually. I guess that bit is a bit redundant...

Thanks!

In reply to Re^2: Could I get some feedback on my code please? by PockMonk
in thread Could I get some feedback on my code please? by PockMonk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.