Why? The current code is perfectly valid. The only reason I know of to use the &sub syntax (other than playing nasty games with @_, which I don't often see) is to distinguish your own subs from the built-ins, which is already taken care of in this case by the mixed-case subroutine name.

If I were to pick nits at that code, I would say that return undef unless ... should be replaced with return unless ... , since return with no arguments produces undef in any case, in scalar context, and will behave sensibly in list context as well (which return undef will not--and thanks to chromatic for reminding me of that).

If I were really in a mood to pick nits, I would say that much more typing went into that code than was strictly necessary: assuming you just need to return truth or falsehood, it can be reduced to

return defined(WebPageParameter($Hash->{$Entry}->{2}, $Hash->{0}->{2 +})) && defined(WebPageParameter($Hash->{$Entry}->{3}, $Hash->{0}->{3 +})) && defined(WebPageParameter($Hash->{$Entry}->{4}, $Hash->{0}->{4 +})) && defined(WebPageParameter($Hash->{$Entry}->{5}, $Hash->{0}->{5 +})) && defined(WebPageParameter($Hash->{$Entry}->{6}, $Hash->{0}->{6 +})) && defined(WebPageParameter($Hash->{$Entry}->{7}, $Hash->{0}->{7 +}));

In this case, the calling code seems to test for definedness instead of truth--I'd rather change that test, but if that's undesirable, just change the above to this:

if ( defined(WebPageParameter($Hash->{$Entry}->{2}, $Hash->{0}->{2 +})) && defined(WebPageParameter($Hash->{$Entry}->{3}, $Hash->{0}->{3 +})) && defined(WebPageParameter($Hash->{$Entry}->{4}, $Hash->{0}->{4 +})) && defined(WebPageParameter($Hash->{$Entry}->{5}, $Hash->{0}->{5 +})) && defined(WebPageParameter($Hash->{$Entry}->{6}, $Hash->{0}->{6 +})) && defined(WebPageParameter($Hash->{$Entry}->{7}, $Hash->{0}->{7 +})) ) { return 1; } else { return; }

As to your actual problem, the message means that at the 29th line of the code supplied to the 13th eval call (presumably in some other module, possibly CGI.pm), you hit an uninitialized value. If you really want to know, you should run the script on the command line in the debugger: when it hits the warning, it will (I think) print a stack trace, which should allow you to track down the problem.



If God had meant us to fly, he would *never* have given us the railroads.
    --Michael Flanders


In reply to Re: Re: Unexpected warnings in log file. by ChemBoy
in thread Unexpected warnings in log file. by krisahoch

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.