Thank you very much for your kind help!my $n=1; open (LOG, "log/anuncis.txt") || die "$!"; while (<LOG>) { chomp; my @attributes = split /\|/; if ($attributes[0] =~m/Di*/){ print "<TABLE WIDTH=65% BORDER=2 ALIGN=CENTER>\n"; print "<TR BGCOLOR=#00FF00B><B>Anunci número $n del $attri +butes[0]</B></TR>\n"; print "<TR>De <B>$attributes[1] $attributes[2]</B> que vol + vendre <FONT COLOR=#FA8072><B>$attributes[6] a $attributes[7] ?.</B> +</FONT></TR>\n"; print "<TR>Us hi podeu posar en contacte al(s) telèfon(s) +<B><FONT COLOR=#FA8072>$attributes[8] // $attributes[9]</B></FONT></T +R>\n"; print "<TR>Segons l'horari que ens indica: <B><FONT COLOR= +#FA8072>$attributes[5]</B></FONT></TR>\n"; print "<TR>O bé al correu electrònic: <B>$attributes[10]</ +B> o a la seva URL <B>$attributes[11]</B></TR>\n"; print "<TR BGCOLOR=#FFA500><B>AQUESTS SÓN ELS SEUS COMENTA +RIS:</B>\n"; print "<BR><FONT COLOR=#8B0000><I><B>$attributes[12]</I></ +B></TR></FONT></TABLE>\n"; print "<BR><BR>\n";} else{ print "<TABLE WIDTH=65% BORDER=2 ALIGN=CENTER>\n"; print "<TR BGCOLOR=#9999FF><B>Anuncio número $n del $attri +butes[0]</B></TR>\n"; print "<TR>De <B>$attributes[1] $attributes[2]</B> que des +ea vender <FONT COLOR=#003366><B>$attributes[6] a $attributes[7] ?.</ +B></FONT></TR>\n"; print "<TR>Os podéis poner en contacto con el/ella en los +teléfonos <B><FONT COLOR=#003366>$attributes[8] // $attributes[9]</B> +</FONT></TR>\n"; print "<TR>Según el horario que nos idica: <B><FONT COLOR= +#003366>$attributes[5]</B></FONT></TR>\n"; print "<TR>Su e-Mail es: <B>$attributes[10]</B> y su URL: +<B>$attributes[11]</B></TR>\n"; print "<TR BGCOLOR=#FF9999><B>ESTOS SON SUS COMENTARIOS:</ +B>\n"; print "<BR><FONT COLOR=#333333><I><B>$attributes[12]</I></ +B></TR></FONT></TABLE>\n"; print "<BR><BR>\n";} $n++; } close LOG;
Edit kudra, 2002-06-15 READMORE tag added
In reply to If-else problem by Kuntent
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |