Just a point of preference but:
Try replacing:
my $tags =''; if ($form{'abstract'} ne "") { $tags .= qq(<meta name="abstract" content="$form{'abstract'}"><br +>\n); } if ($form{'author'} ne "") { $tags .= qq(<meta name="author" content="$form{'author'}"><br>\n) +; } if ($form{'distributor'} ne "") { $tags .= qq(<meta name="distributor" content="$form{'distributor' +}"><br>\n); } if ($form{'copyright'} ne "") { $tags .= qq(<meta name="copyright" content="$form{'copyright'}">< +br>\n); } if ($form{'keywords'} ne "") { $tags .= qq(<meta name="keywords" content="$form{'keywords'}"><br +>\n); } if ($form{'description'} ne "") { $tags .= qq(<meta name="description" content="$form{'description' +}"><br>\n); } $tags .= qq(<meta name="generator" content="SpyderTagV1.0!"><br>\n); if ($form{'robots'} ne "") { $tags .= qq(<meta name="robots" content="$form{'robots'}"><br>\n) +; } if ($form{'language'} ne "") { $tags .= qq(<meta name="language" content="$form{'language'}"><br +>\n); } if ($form{'distribution'} ne "") { $tags .= qq(<meta name="distribution" content="$form{'distributio +n'}"><br>\n); } if ($form{'rating'} ne "") { $tags .= qq(<meta name="rating" content="$form{'rating'}"><br>\n) +; } print my $cgi->escapeHTML( $tags);

With:
print my $cgi->escapeHTML( join '', ( map{ defined($form{$_}) ? qq(<meta name="$_" content="$form{$_}"><br> +\n):'' } qw ( abstract author distributor copyright description robots language distribution rating ) ),'<meta name="generator" content="SpyderTagV1.0!"><br>\n' );

Explanation This uses the functional programming idiom, so start from the inner-most loop and work back.

Other "useful" notes:

One of the first things I learnt in Perl was to recognise repetitive patterns and then get rid of them.
I'm lazy.
A by product is if you want to add more meta fields it's easier now :)

--

Brother Frankus.

¤


In reply to Re: Problems printing to browser by frankus
in thread Problems printing to browser by sulfericacid

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.