Dear Friends, I'm having a new problem with the following script:
#!/usr/bin/perl -wT #author: Kunt Unt #Creation date: 10/06/2002 use strict; my $n=1; open (LOG, "anuncis.txt") || die "$!"; while (<LOG>) { chomp; my @attributes = split /\|/; foreach my $attribute (@attributes) { print "<TABLE WIDTH=65% BORDER=1 ALIGN=CENTER>\n"; print "<TR BGCOLOR=#00FF00B>Anunci número $n del $attribut +es[0]</TR>\n"; print "<TR>De $attributes[1] $attributes[2] que vol vendre + $attributes[6] a $attributes[7] €.</TR>\n"; print "<TR>Us hi podeu posar en contacte al(s) telèfon(s) +$attributes[8] // $attributes[9]</TR>\n"; print "<TR>Segons l'horari que ens indica: $attributes[5]< +/TR>\n"; print "<TR>O bé al correu electrònic $attributes[10] o a l +a seva URL $attributes[11]</TR>\n"; print "<TR>Aquests són els seus comentaris:\n"; print "<P> <FONT COLOR=#DAA520>$attributes[12]</TR></TABLE +>\n"; print "<BR><BR>\n"; } $n++; } close LOG; print qq(<HR>Retorn a la nostra pàgina <a href="http://localhost/anunc +is.htm"> principal</a>);
It's supposed to print only the atrributes in each line, which it does, but it shows me as many messages as attributes the user has input. How can I solve it? Any idea? Thank you very much in advance

In reply to Too many outputs by Kuntent

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.