<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Se você tiver memória ram sobrando para a leitura do arquivo texto, eu recomendo usar hash slice.</div><div><br></div>my @keys;<div>my @replace;</div><div>$. % 2 == 0 ? push $_, @keys : push $_, @replace while(<$fh>);</div><div><div>my %hash;</div><div>@hash{@keys} = @replace;</div><div><br></div><div>Caso contrário você também pode fazer:</div><div><br></div><div>my ($key,$value);</div><div>while(my $line = <$fh>){</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>if($line % 2 == 0) {</div><div>          $key = $line;</div><div><span class="Apple-tab-span" style="white-space:pre">  </span>}</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>else {</div><div>         $value = $line;</div><div>       }</div><div><span class="Apple-tab-span" style="white-space:pre">    </span>if ($key && $value) {</div><div>           repalce_here($key,$value);</div><div><span class="Apple-tab-span" style="white-space:pre">      </span>  ($key,$value) = (undef,undef);</div><div>        }</div><div>}</div><div><br><div>
<span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">-- <br>Software Engineer<br>Just Another Perl Hacker<br>Daniel Mantovani +5511 8538-9897<br>XOXO</div></span></div></span></span>
</div>
<br><div><div>On Feb 25, 2012, at 8:40 PM, André Torres wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">pessoal, queria pedir uma ajuda de vcs.<br><br>eu to tentando fazer um script pra modificar um txt em larga escala usando uma lista de substituição.<br>vou trabalhar com os seguintes arquivos.<br><br>primeiro: arquivo que vai ser modificado<br>
>sequencia1<br>acagacagatttagatt<br>>sequencia2<br>acgggtagtagtaccgagatgagatggggat<br>...<br><br>segundo: lista de substituição<br>sequencia1    gene1<br>sequencia2    gene2<br>...<br><br>eu queria saber se existe uma maneira de guardar a informação da linha[1] e da linha[2] por exemplo possam fazer parte  s/$linha[1]/$linha[2]/g em cadeia ate terminar a lista.<br>
<br>agradeço desde já a vcs.<br>abraço.<br clear="all"><br>-- <br>André Torres<br><br>"Quando o homem aprender a respeitar até o menor ser da criação, seja animal ou vegetal, ninguém precisará ensiná-lo a amar seu semelhante." (Albert Schweitzer - Nobel da Paz de 1952)<br>

_______________________________________________<br>Rio-pm mailing list<br><a href="mailto:Rio-pm@pm.org">Rio-pm@pm.org</a><br>http://mail.pm.org/mailman/listinfo/rio-pm</blockquote></div><br></div></div></body></html>