<html>
<head>
<style>
P
{
margin:0px;
padding:0px
}
body
{
FONT-SIZE: 10pt;
FONT-FAMILY:Tahoma
}
</style>
</head>
<body>Segue os dois centavos de hoje abaixo...<BR><BR>> > dei uma melhorada no meu script... alguém quer me ajudar?<BR>
<BR>
Eu coloquei nomes de variáveis mais compreensíveis no seu código... não testei, então alguns erros gerados pela pragma strict podem acontecer.<BR><BR>
<code><BR>#!/usr/bin/perl<BR><BR>
use warnings;<BR>use strict;<BR>use WWW::Mechanize;<BR>use IO::Uncompress::Gunzip;<BR><BR>my $browser = WWW::Mechanize->new;<BR>my $onde = shift || "rio";<BR>my %monks;<BR>$browser->get(" http://mail.pm.org/pipermail/$onde-pm/");<BR>my @links = $browser->find_all_links( url_regex => qr#\d{4}-\w+.txt#, );<BR><BR>for my $link (@links) { <BR><BR> print $link->url_abs(), $/;<BR> $browser->get($link->url_abs);<BR><BR> my $content = $browser->content();<BR> my $buffer;<BR><BR> if ($link->url_abs =~ /\.gz$/) {<BR><BR> my $unzip_content = new IO::Uncompress::Gunzip \$content;<BR> $unzip_content->read($buffer);<BR><BR> } else {<BR><BR> $buffer = $content;<BR><BR> }<BR><BR> $buffer =~ s#<code>.*?</code>##gsm;<BR>
<BR>
my $from;<BR><BR>
# que diabos é $a?<BR>
for my $a ( split m#$/#, $buffer ) {<BR><BR>
$from = $1 if $a =~ m#^\s*From: (.+)$#;<BR><BR>
if($a =~ /^\s*\(?([\w]+)\)?((:?\+|-){2})\s*(#.*)?$/) {<BR><BR>
# não dá para tirar esse eval daqui? seria melhor por questões de performance<BR>
eval "\$monks{" . lc $1 . "}$2";<BR> <BR>
print "From: $from$/$a$/$/";<BR><BR>
}<BR>
}<BR>}<BR><BR>
print "$_ => $hash{$_}$/" for keys %monks;<BR><BR>
</code><BR><BR>[]'s<BR>
Alceu<BR><br /><hr />Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy! <a href='http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us' target='_new'>Try it!</a></body>
</html>