Bom, perldoc benchmark já explicaria (alguém mencionou &quot;man benchmark&quot; mas isso não funcionou aqui no meu mac)<br><br>Basicamente o &quot;Rate&quot; indica quantas vezes por segundo a rotina foi chamada, ou seja, é a &quot;velocidade&quot; dela; mais rápido = melhor.
<br><br>A tabela te diz, por exemplo, que o método &quot;tr&quot; foi 247% mais rápido que o método array, ou que &quot;while&quot; foi 37% mais lento que &quot;tr&quot;.<br><br>[]s<br>Wendel <br><br><br><div class="gmail_quote">
On Nov 21, 2007 3:27 PM,  &lt;<a href="mailto:fernandolouis@terra.com.br">fernandolouis@terra.com.br</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">






<div bgcolor="#ffffff">
<div><font face="Trebuchet MS" size="2">sim, a palavra &quot;benchmark&quot; eu sei o que 
é... sou formado em design também.</font></div>
<div><font face="Trebuchet MS" size="2"></font>&nbsp;</div>
<div><font face="Trebuchet MS" size="2">como bons &quot;amigos&quot;, seria mais fácil 
explicar o que realmente foi perguntado e não a &quot;palavra&quot; em si.</font></div>
<div><font face="Trebuchet MS" size="2"></font>&nbsp;</div>
<div><font face="Trebuchet MS" size="2">Então o que exatamente significam os 
valores em &lt;resultado&gt;?</font></div>
<div><font face="Trebuchet MS" size="2">Sei que é uma medição para ver as melhores 
performances.... mas não compreendi totalmente.</font></div><div class="Ih2E3d">
<div><font face="Trebuchet MS" size="2"></font>&nbsp;</div>
<div><span style="font-family: courier new,monospace;">&lt;resultado&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
Rate array while&nbsp;&nbsp;&nbsp; tr</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">array 1090778/s&nbsp;&nbsp;&nbsp; 
--&nbsp; -54%&nbsp; -71% </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">while 2388776/s&nbsp; 
119%&nbsp;&nbsp;&nbsp; --&nbsp; -37%</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">tr&nbsp;&nbsp;&nbsp; 3781862/s&nbsp; 
247%&nbsp;&nbsp; 58%&nbsp;&nbsp;&nbsp; --</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&lt;/resultado&gt;</span></div>
<div><span style="font-family: courier new,monospace;"></span>&nbsp;</div>
<div><span style="font-family: courier new,monospace;"><font face="Trebuchet MS" size="2"></font></span>&nbsp;</div>
</div><blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;"><div class="Ih2E3d">
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- Original Message ----- </div>
  <div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b> 
  <a title="cromo.jml@gmail.com" href="mailto:cromo.jml@gmail.com" target="_blank">Márcio 
  Vitor</a> </div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> <a title="cascavel-pm@pm.org" href="mailto:cascavel-pm@pm.org" target="_blank">
Cascavel Perl Mongers</a> </div></div><div><div></div><div class="Wj3C7c">
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> Wednesday, November 21, 2007 2:47 
  PM</div>
  <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> Re: [Cascavel-pm] Contando 
  caractares</div>
  <div><font face="Trebuchet MS" size="2"></font><br></div>Poxa Fernando na boa, 
  fazer uma pesquisa não é tão mais difícil do que perguntar na lista, fiz a 
  pesquisa e a primeira ocorrência é deste link (em português):<br><a href="http://pt.wikipedia.org/wiki/Benchmark+" target="_blank">http://pt.wikipedia.org/wiki/Benchmark 
  </a><br><br>Abraços<br><br>Márcio Vitor<br><br>
  <div class="gmail_quote">On Nov 21, 2007 2:41 PM, &lt;<a href="mailto:fernandolouis@terra.com.br" target="_blank">fernandolouis@terra.com.br</a>&gt; 
  wrote:<br>
  <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
    <div bgcolor="#ffffff">
    <div><font face="Trebuchet MS" size="2">Amigo,</font></div>
    <div><font face="Trebuchet MS" size="2"></font>&nbsp;</div>
    <div><font face="Trebuchet MS" size="2">não compreendi o 
    &lt;resultado&gt;&lt;/resultado&gt;</font></div>
    <div><font face="Trebuchet MS" size="2"></font>&nbsp;</div>
    <div><font face="Trebuchet MS" size="2">o que exatamente siginifcam os 
    valores? E pra que serve o &quot;Benchmark&quot;?</font></div>
    <div><font face="Trebuchet MS" size="2"></font>&nbsp;</div>
    <div><font face="Trebuchet MS" size="2">[]s,</font></div>
    <div><font face="Trebuchet MS" size="2">Fernando</font></div>
    <div><font face="Trebuchet MS" size="2"></font>&nbsp;</div>
    <blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;">
      <div>
      <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">----- 
      Original Message ----- </div>
      <div style="background: rgb(228, 228, 228) none repeat scroll 0% 50%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;">
<b>From:</b> 
      <a title="shonorio@gmail.com" href="mailto:shonorio@gmail.com" target="_blank">Solli Honorio</a> </div>
      <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>To:</b> 
      <a title="cascavel-pm@pm.org" href="mailto:cascavel-pm@pm.org" target="_blank">Cascavel Perl Mongers</a> </div>
      <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Sent:</b> 
      Tuesday, November 20, 2007 6:28 PM</div>
      <div style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 10pt; line-height: normal; font-size-adjust: none; font-stretch: normal;"><b>Subject:</b> 
      Re: [Cascavel-pm] Contando caractares</div>
      <div><br></div></div>
      <div>
      <div></div>
      <div><span style="font-family: courier new,monospace;">Não 
      resisti, que tal um golfe ?</span><br style="font-family: courier new,monospace;"><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">$q=$v=~y/a//;</span><br style="font-family: courier new,monospace;">
<br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">... e tem outra coisa, o &#39;tr&#39; 
      ou &#39;y&#39; é mais rápido ... </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&lt;code&gt;<br>use Benchmark 
      qw(:all) ;<br>my $var&nbsp;&nbsp; = &#39;parlamentarismo&#39;;<br><br>cmpthese(-1, 
      {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      &#39;array&#39; =&gt; <a href="mailto:%27@%7B%5B$var" target="_blank">&#39;@{[$var</a> 
      =~ /a/g]}&#39;, 
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      &#39;while&#39; =&gt; &#39;while ( $var =~ /a/g ) { 
      $qtd02++}&#39;,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      &#39;tr&#39;&nbsp;&nbsp;&nbsp; =&gt; &#39;$var =~ 
      y/a/A/&#39;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      });<br style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">&lt;/code&gt;<br><br style="font-family: courier new,monospace;"></span><span style="font-family: courier new,monospace;">
&lt;resultado&gt;</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 
      Rate array while&nbsp;&nbsp;&nbsp; tr</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">array 
      1090778/s&nbsp;&nbsp;&nbsp; --&nbsp; -54%&nbsp; -71% </span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">while 2388776/s&nbsp; 
      119%&nbsp;&nbsp;&nbsp; --&nbsp; -37%</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">tr&nbsp;&nbsp;&nbsp; 
      3781862/s&nbsp; 247%&nbsp;&nbsp; 58%&nbsp;&nbsp;&nbsp; --</span><br style="font-family: courier new,monospace;"><span style="font-family: courier new,monospace;">&lt;/resultado&gt;<br><br style="font-family: courier new,monospace;"></span>
      <div class="gmail_quote">On Nov 20, 2007 3:15 PM, Adriano Ferreira &lt;<a href="mailto:a.r.ferreira@gmail.com" target="_blank">a.r.ferreira@gmail.com</a>&gt; wrote:<br>
      <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
        <div>
        <div></div>
        <div>On Nov 20, 2007 9:35 AM, &nbsp;&lt;<a href="mailto:fernandolouis@terra.com.br" target="_blank">fernandolouis@terra.com.br</a>&gt; 
        wrote:<br>&gt;<br>&gt;<br>&gt; Dae Pessoal... olha só...<br>&gt;<br>&gt; 
        $variavel = &quot;casa&quot;; <br>&gt; Como faço pra contar quantos &quot;a&quot; tem em 
        $variavel?<br>&gt; Tentei o seguinte, mas não fucionou:<br>&gt; $qtd = 
        $variavel =~ m /a/g;<br><br></div></div>Se o que você quer é apenas 
        contar caracteres, use tr// <br><br>$qtd = $variavel =~ 
        tr/a/a/;<br><br>Leia sobre o operator em &quot;perldoc perlop&quot; e sobre este 
        uso em particular.<br><br></blockquote></div></div></div></blockquote></div></blockquote></div></div></div></blockquote></div></blockquote></div>