Legal!<br>Aproveitando: como vocês fazem para dar um shuffle() num array qqer? Eu costumo fazer:<br><br>my @x = (1..10);<br>for (my $i = 0; $i <= $#x; $i++) {<br> my $j = rand $#x;<br> ($x[$i], $x[$j]) = ($x[$j], $x[$i])<br>
}<br><br>ABS()<br><br>
<br><br><div class="gmail_quote">On Fri, Nov 5, 2010 at 01:31, Daniel de Oliveira Mantovani <span dir="ltr"><<a href="mailto:mantovani@perl.org.br">mantovani@perl.org.br</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<a href="http://stackoverflow.com/questions/4092348/in-perl-how-can-i-generate-an-array-with-random-values-without-using-a-loop" target="_blank">http://stackoverflow.com/questions/4092348/in-perl-how-can-i-generate-an-array-with-random-values-without-using-a-loop</a><br>
<br>
Além do conceito, eu achei interessante o hack para alterar uma função nativa.<br>
<br>
[]'s<br>
<font color="#888888"><br>
--<br>
"If you’ve never written anything thoughtful, then you’ve never had<br>
any difficult, important, or interesting thoughts. That’s the secret:<br>
people who don’t write, are people who don’t think."<br>
_______________________________________________<br>
SaoPaulo-pm mailing list<br>
<a href="mailto:SaoPaulo-pm@pm.org">SaoPaulo-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/saopaulo-pm" target="_blank">http://mail.pm.org/mailman/listinfo/saopaulo-pm</a><br>
</font></blockquote></div><br>