That statement is just asking for a rewrite. Adding or removing new vars is a pain, finding vars is a pain, reading it is a pain, and if the errors are empty you end up with empty lines in the output. Also learn to use qq() and q() instead of "" and '' when you have to include the quote chars inside. Anyway. The following is something like the way an older hand might write this.

$error_html = join "<br />\n", qq(<font size="2" face="verdana" color="#CCCCCC">) . qq(<b>Please fix the following errors:</font>) . qq(<font size="1" face="verdana" color="#003471">), (grep { defined $_ } $error_msg_x, $error_msg_xx, $error_msg_xxx, $error_msg_pw_xxx, $error_msg_pw_x, $error_msg_pw_xx, $error_msg_terms, $error_msg_email, $error_msg_city, $error_msg_state, $error_msg_date, $error_msg_zip ), "</b></font>\n" ;

I have concerns that these error variables are inappropriate. Maybe you should have an @errors array and when you encounter an error do something like:

push @errors,"<b>Password:</b> You must enter a value";
And then you could replace the list of vars there with @errors and lose the grep (actually everything inside that (grep ...) expression)

Also there is a possible issue that if your error message contains html or html characters that it should actually be escaped before printing. This may not be an issue for you, but its worth keeping in mind.

hth


---
demerphq

    First they ignore you, then they laugh at you, then they fight you, then you win.
    -- Gandhi



In reply to Re: Warnings, strict HTML scalar by demerphq
in thread Warnings, strict HTML scalar by perleager

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.