From 3febcdedbc0e2e367ff7cc2c1e2b611408f2bb19 Mon Sep 17 00:00:00 2001 From: Ryan Voots Date: Tue, 5 Oct 2010 00:49:04 -0400 Subject: [PATCH] i'm trying to make it more complicated than it needs to be --- plugins/8ball.pm | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/plugins/8ball.pm b/plugins/8ball.pm index 61a8f4a..fd8d84d 100644 --- a/plugins/8ball.pm +++ b/plugins/8ball.pm @@ -24,21 +24,13 @@ sub { my( $said ) = @_; my $ors =()= $said->{body}=~m/\bor\b/g; - my $commas =()= $said->{body}=~m/,(?=.*\bor\b)/g; my $common = ""; my @a; - if ($ors == 1) + if ($ors >= 1) { - if ($commas > 0) - { - @a = split(/\bor\b/, $said->{body}); - } - else - { - @a = split(/(?:\bor\b|\s*,\s*)+/, $said->{body}); - } + @a = split(/(?:\bor\b|\s*,\s*)+/, $said->{body}); s/^\s*//, s/\s*(\?\s*)?$// for @a; #trim them up