All pastes #210047 Raw Edit

Stuff

public text v1 · immutable
#210047 ·published 2006-10-19 14:08 UTC
rendered paste body
#Context    Mbox  User                      Zone       NewMsg
#default    1234  Example Mailbox                           1
#other      1234  Company2 User                             0

my ($results,$start)=(0,0);

#my @fields;
while (($line = $pop->getline)  and ($line !~ /--END/o))
{
    if ($start) {
#        @fields = (split ' ', $line);
#        $results = $results + pop(@fields);
         my $NewMsg = (split ' ', $line)[3]; # Pega o valor da 4 coluna
         $results += $NewMsg if ($NewMsg =~ /\d/); # Vai somando os valores se eles contiverem números
    }

    $start = 1 if ($line =~ /Context/o);
}