<html><body>
<p>Valeu Thomas, brigadão mesmo.<br>
<br>
t+<br>
Diego<br>
<br>
<br>
.============================================.<br>
Diego Mendes Teixeira - diegom@lcc.ufmg.br <br>
Desenvolvimento de Sistemas - LCC/CENAPAD<br>
Universidade Federal de Minas Gerais - UFMG <br>
Cel: +55(31)8842-9951 - Tel(trab): +55(31)34994910 <br>
'============================================'<br>
<img src="cid:10__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" width="16" height="16" alt="Inativo ocultar detalhes deThomas Britis <thomas@tcnet.com.br>">Thomas Britis <thomas@tcnet.com.br><br>
<br>
<br>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td style="background-image:url(cid:20__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br); background-repeat: no-repeat; " width="40%">
<ul>
<ul>
<ul>
<ul><b><font size="2">Thomas Britis <thomas@tcnet.com.br></font></b><font size="2"> </font><br>
<font size="2">Enviado Por: cascavel-pm-bounces+diegom=lcc.ufmg.br@pm.org</font>
<p><font size="2">25/10/2006 15:30</font>
<table border="1">
<tr valign="top"><td width="168" bgcolor="#FFFFFF"><div align="center"><font size="2">Favor responder a<br>
Cascavel Perl Mongers <cascavel-pm@pm.org></font></div></td></tr>
</table>
</ul>
</ul>
</ul>
</ul>
</td><td width="60%">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="1%" valign="middle"><img src="cid:30__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" border="0" height="1" width="58" alt=""><br>
<div align="right"><font size="2">Para</font></div></td><td width="100%"><img src="cid:30__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" border="0" height="1" width="1" alt=""><br>
<font size="2">Cascavel Perl Mongers <cascavel-pm@pm.org></font></td></tr>
<tr valign="top"><td width="1%" valign="middle"><img src="cid:30__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" border="0" height="1" width="58" alt=""><br>
<div align="right"><font size="2">cc</font></div></td><td width="100%"><img src="cid:30__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" border="0" height="1" width="1" alt=""><br>
</td></tr>
<tr valign="top"><td width="1%" valign="middle"><img src="cid:30__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" border="0" height="1" width="58" alt=""><br>
<div align="right"><font size="2">Assunto</font></div></td><td width="100%"><img src="cid:30__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" border="0" height="1" width="1" alt=""><br>
<font size="2">Re: [Cascavel-pm] Manipulação de arquivo</font></td></tr>
</table>
<table border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td width="58"><img src="cid:30__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" border="0" height="1" width="1" alt=""></td><td width="336"><img src="cid:30__=0CBBF881DFF59B808f9e8a93df@grude.ufmg.br" border="0" height="1" width="1" alt=""></td></tr>
</table>
</td></tr>
</table>
<br>
<tt>Leia a documentação do substr que você vai entender no ato.<br>
<br>
                 Se não entender, é só dizer.<br>
<br>
                 Abraços,<br>
<br>
Diego Mendes Teixeira wrote:<br>
> Ficou bem bacana Thomas. Vou testar a noite quando eu chegar na facul. <br>
> Mas eu fiquei meio confuso, pois tem expressoes que para um cara <br>
> iniciante (e confesso, começando a gostar muito e interessar por perl) <br>
> são novas.... queria entender mais detalhadamente o código. Como a <br>
> expressao que voce usa no laço: ((substr ($nome, $x, 1) eq substr ($_, <br>
> $x, 1)) && (substr($_, $x, 1) ne $delim))<br>
> <br>
> Brigadão ai pela ajuda.<br>
> <br>
> Diego<br>
> <br>
> <br>
> .============================================.<br>
> Diego Mendes Teixeira - diegom@lcc.ufmg.br<br>
> Desenvolvimento de Sistemas - LCC/CENAPAD<br>
> Universidade Federal de Minas Gerais - UFMG<br>
> Cel: +55(31)8842-9951 - Tel(trab): +55(31)34994910<br>
> '============================================'<br>
> Inativo ocultar detalhes deThomas Britis <thomas@tcnet.com.br>Thomas <br>
> Britis <thomas@tcnet.com.br><br>
> <br>
> <br>
> *Thomas Britis <thomas@tcnet.com.br>*<br>
> Enviado Por:<br>
> cascavel-pm-bounces+diegom=lcc.ufmg.br@pm.org<br>
> <br>
> 25/10/2006 14:39<br>
> Favor responder a<br>
> Cascavel Perl Mongers <cascavel-pm@pm.org><br>
> <br>
>                  <br>
> <br>
> Para<br>
>                  <br>
> Cascavel Perl Mongers <cascavel-pm@pm.org><br>
> <br>
> cc<br>
>                  <br>
> <br>
> Assunto<br>
>                  <br>
> Re: [Cascavel-pm] Manipulação de arquivo<br>
> <br>
>                  <br>
> <br>
> <br>
> Fiz um programa (meio porco) usando a estrutura que você estava usando<br>
> no outro para comparação exata sem uso de expressão regular:<br>
> <br>
> my ($nome) = $ARGV[0] || die "Uso: $0 [palavra] [arquivo]\n";<br>
> my ($delim) = ":"; # Delimitador já que você só considera a primeira<br>
> parte, correto?<br>
> my ($linha);<br>
> my ($achei) = 0;<br>
> my ($x);<br>
> <br>
> open (F, "</$ARGV[1]");<br>
> while (<F>) {<br>
> $linha++;<br>
> $x = 0;<br>
> while ((substr ($nome, $x, 1) eq substr ($_, $x, 1)) && (substr<br>
> ($_, $x, 1) ne $delim)) { $x++; }<br>
> if ($x eq length ($nome)) {<br>
> print "Achei em linha $linha\n";<br>
> $achei++;<br>
> last;<br>
> }<br>
> }<br>
> <br>
> print "Nao achei\n" if (!$achei);<br>
> <br>
> -- <br>
> Thomas Storino Britis<br>
> TCNet Informatica e Telecomunicacoes LTDA<br>
> _______________________________________________<br>
> Cascavel-pm mailing list<br>
> Cascavel-pm@pm.org<br>
> </tt><tt><a href="http://mail.pm.org/mailman/listinfo/cascavel-pm">http://mail.pm.org/mailman/listinfo/cascavel-pm</a></tt><tt><br>
> <br>
> <br>
> ------------------------------------------------------------------------<br>
> <br>
> _______________________________________________<br>
> Cascavel-pm mailing list<br>
> Cascavel-pm@pm.org<br>
> </tt><tt><a href="http://mail.pm.org/mailman/listinfo/cascavel-pm">http://mail.pm.org/mailman/listinfo/cascavel-pm</a></tt><tt><br>
<br>
-- <br>
Thomas Storino Britis<br>
TCNet Informatica e Telecomunicacoes LTDA<br>
_______________________________________________<br>
Cascavel-pm mailing list<br>
Cascavel-pm@pm.org<br>
</tt><tt><a href="http://mail.pm.org/mailman/listinfo/cascavel-pm">http://mail.pm.org/mailman/listinfo/cascavel-pm</a></tt><tt><br>
</tt><br>
</body></html>