Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
It's far from the worse code I've seen ;-) Seriously it's not bad. There are a few minor nits here and there.
use Date::Calc qw(Date_to_Text_Long);
qw is unnecessary for a single element, and inconsistent with line 3
use DBI();
do you really mean a null import list? it would also perhaps be better to insert whitespace between DBI and the parens. (I did say these were nits ;-)
Use of ' for things that needn't be interpolated is a good habit.
'index' => 'do_index',
keys of \w+ don't need to be quoted with =>
$self->param('dbh' => DBI->connect("DBI:mysql:database=authorweb;host=localhost",
You might look at DBIx::Connect.
if ($cgi->param('alpha') =~ /^(A-Za-z){1}$/)
the {1} is meaningless here
" "
This might be a good place for a dispatch table or mock switch statement, especially if you might add functionality in the future.
'Corwin\'s AuthorWeb'
This is unnecessarily repeated, you might consider setting it up in a package global or constant?
my is somewhat expensive
You might consider grouping all of them at a head of the block eg; my($foo, $bar) The difference is rather small (4% for 4 scalars in my tests) but could make a difference on high traffic site. As a matter of taste it might be prefertial to see all of the variables of a block in one location.
my $ref = $sth->fetchrow_hashref();
I would instead immediately pass the fetch result directly to your sub, this would also allow you to collapse the entire if statement into one lie. either foo if bar or bar && foo
There are several places you could take advantage of $_, but this is personal preference, I happen to like dense code.
if ($ref->{'dob'})
thse kind of things often look and read (as English) better as a single line of code like the previous if.

perl -pew "s/\b;([mnst])/'$1/g"

In reply to Re: Help with my Coding Style - another chance to critique by belg4mit
in thread Help with my Coding Style - another chance to critique by rattusillegitimus

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, 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, 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.
  • Log In?

    What's my password?
    Create A New User
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others contemplating the Monastery: (5)
    As of 2020-12-01 11:39 GMT
    Find Nodes?
      Voting Booth?
      How often do you use taint mode?

      Results (5 votes). Check out past polls.