Hi, How do I stop an empty table row from being printed if one or both $arr[?] is empty?
sub registerform { $sth=runSQL(qq|SELECT usr.name, sl.sdsc1, sl.surl1, sl.header, sl. +sdsc2, sl.surl2, sl.sdsc3, sl.surl3, sl.sdsc4, sl.surl4, sl.sdsc5, sl +.surl5, sl.sdsc6, sl.surl6, sl.sdsc7, sl.surl7, sl.sdsc8, sl.surl8, s +l.sdsc9, sl.surl9, sl.sdsc10, sl.surl10, sl.sdsc11, sl.surl11 FROM users usr, sitelinks sl # $db_users WHERE usr.userid='$refer' AND sl.userid='$refer' AND sl.status +=1|); @arr=$sth->fetchrow; # # $arr[1]=~ s/\<//g; $arr[1]=~ /(.{1,64}\W)/ms; $link0="<a href=http://$arr[2]>$arr[1]</a>"; # $link1="<tr><td><a href=http://$arr[5]>$arr[4]</a><br><br></tr></t +d>"; $link2="<tr><td><a href=http://$arr[7]>$arr[6]</a><br><br></tr></t +d>"; $link3="<tr><td><a href=http://$arr[9]>$arr[8]</a><br><br></tr></t +d>"; $link4="<tr><td><a href=http://$arr[11]>$arr[10]</a><br><br></tr>< +/td>"; $link5="<tr><td><a href=http://$arr[13]>$arr[12]</a><br><br></tr>< +/td>"; $link6="<tr><td><a href=http://$arr[15]>$arr[14]</a><br><br></tr>< +/td>"; $link7="<tr><td><a href=http://$arr[17]>$arr[16]</a><br><br></tr>< +/td>"; $link8="<tr><td><a href=http://$arr[19]>$arr[18]</a><br><br></tr>< +/td>"; $link9="<tr><td><a href=http://$arr[21]>$arr[20]</a><br><br></tr>< +/td>"; $link10="<tr><td><a href=http://$arr[23]>$arr[22]</a></tr></td>"; # my $templ=opentemplate('regform','normal'); substemplate($templ,'fullname',$arr[0]); substemplate($templ,'header',$arr[3]); substemplate($templ,'link0',$link0); substemplate($templ,'link1',$link1); substemplate($templ,'link2',$link2); substemplate($templ,'link3',$link3); substemplate($templ,'link4',$link4); substemplate($templ,'link5',$link5); substemplate($templ,'link6',$link6); substemplate($templ,'link7',$link7); substemplate($templ,'link8',$link8); substemplate($templ,'link9',$link9); substemplate($templ,'link10',$link10); substemplate($templ,'refer',$refer?$refer:'none'); print $templ; }
qw(I think I have painted myself into a corner.) Thank you in advance.

In reply to Empty table row by new2foo

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.