... my $vote = 0; my ($id, $type); if($decoded =~ /\[([^\]]+?)\]([+-]{2})/) { ($id, $type) = ($1, $2); if($type eq '++') { $vote++; } elsif($type eq '--') { $vote--; } } if(!$vote) { # Not a vote contained in the message, we are done here return 1; } my $reason = ''; if($decoded =~ /^.+?\#(.*)$/) { $reason = $1; $reason =~ s/^\ +//g; $reason =~ s/\ +$//g; } ...