I could stil be a quoting issue. For exmple, spaces are not allowed in URLs. Similarly, the characters <, > and & have special meaning in HTML text, so they need to be escaped too.
use CGI qw( escapeHTML ); use URI::Escape qw( uri_escape ); foreach my $line (@results) { my ($first, $second, $third) = split(/::/, $line); my $ue_first = uri_escape($first); my $ue_second = uri_escape($second); my $ue_third = uri_escape($third); my $he_first = escapeHTML($first); my $he_third = escapeHTML($third); print qq(<b>$he_first</b> <a href="$ue_second?a=$ue_first&t=$ue_thi +rd">$he_third</a><br>); }

Alternate syntax:

use CGI qw( escapeHTML ); use URI::Escape qw( uri_escape ); foreach my $line (@results) { my ($first, $second, $third) = split(/::/, $line); my ($ue_first, $ue_second, $ue_third) = map uri_escape($_), $first, $second, $third; my ($he_first, $he_second, $he_third) = map escapeHTML($_), $first, $second, $third; print qq(<b>$he_first</b> <a href="$ue_second?a=$ue_first&t=$ue_thi +rd">$he_third</a><br>); }

No need to escape for HTML that which has already been escaped for URIs since URIs can't contain any special HTML characters.


In reply to Re^2: weird print results by ikegami
in thread weird print results by Anonymous Monk

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.