<html><body>
<p>Ficou bem bacana Thomas. Vou testar a noite quando eu chegar na facul. Mas eu fiquei meio confuso, pois tem expressoes que para um cara iniciante (e confesso, começando a gostar muito e interessar por perl) são novas.... queria entender mais detalhadamente o código.  Como a expressao que voce usa no laço: <tt>&nbsp;((substr ($nome, $x, 1) eq substr ($_, $x, 1)) &amp;&amp; (substr($_, $x, 1) ne $delim))</tt><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>
<img src="cid:10__=0CBBF881DFF139418f9e8a93df@grude.ufmg.br" width="16" height="16" alt="Inativo ocultar detalhes deThomas Britis &lt;thomas@tcnet.com.br&gt;">Thomas Britis &lt;thomas@tcnet.com.br&gt;<br>
<br>
<br>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr valign="top"><td style="background-image:url(cid:20__=0CBBF881DFF139418f9e8a93df@grude.ufmg.br); background-repeat: no-repeat; " width="40%">
<ul>
<ul>
<ul>
<ul><b><font size="2">Thomas Britis &lt;thomas@tcnet.com.br&gt;</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 14:39</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 &lt;cascavel-pm@pm.org&gt;</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__=0CBBF881DFF139418f9e8a93df@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__=0CBBF881DFF139418f9e8a93df@grude.ufmg.br" border="0" height="1" width="1" alt=""><br>
<font size="2">Cascavel Perl Mongers &lt;cascavel-pm@pm.org&gt;</font></td></tr>

<tr valign="top"><td width="1%" valign="middle"><img src="cid:30__=0CBBF881DFF139418f9e8a93df@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__=0CBBF881DFF139418f9e8a93df@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__=0CBBF881DFF139418f9e8a93df@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__=0CBBF881DFF139418f9e8a93df@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__=0CBBF881DFF139418f9e8a93df@grude.ufmg.br" border="0" height="1" width="1" alt=""></td><td width="336"><img src="cid:30__=0CBBF881DFF139418f9e8a93df@grude.ufmg.br" border="0" height="1" width="1" alt=""></td></tr>
</table>
</td></tr>
</table>
<br>
<tt>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 &quot;Uso: $0 [palavra] [arquivo]\n&quot;;<br>
my ($delim) = &quot;:&quot;; # 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, &quot;&lt;/$ARGV[1]&quot;);<br>
while (&lt;F&gt;) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; $linha++;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; $x = 0;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; while ((substr ($nome, $x, 1) eq substr ($_, $x, 1)) &amp;&amp; (substr <br>
($_, $x, 1) ne $delim)) { $x++; }<br>
 &nbsp; &nbsp; &nbsp; &nbsp; if ($x eq length ($nome)) {<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; print &quot;Achei em linha $linha\n&quot;;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; $achei++;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; last;<br>
 &nbsp; &nbsp; &nbsp; &nbsp; }<br>
}<br>
<br>
print &quot;Nao achei\n&quot; 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>
</tt><br>
</body></html>