1
0
Fork 0
mirror of https://github.com/perlbot/perlbuut synced 2025-06-08 03:40:42 -04:00

i'm trying to make it more complicated than it needs to be

This commit is contained in:
Ryan Voots 2010-10-05 00:49:04 -04:00
parent f40e38f095
commit 3febcdedbc

View file

@ -24,21 +24,13 @@ sub {
my( $said ) = @_; my( $said ) = @_;
my $ors =()= $said->{body}=~m/\bor\b/g; my $ors =()= $said->{body}=~m/\bor\b/g;
my $commas =()= $said->{body}=~m/,(?=.*\bor\b)/g;
my $common = ""; my $common = "";
my @a; my @a;
if ($ors == 1) if ($ors >= 1)
{ {
if ($commas > 0) @a = split(/(?:\bor\b|\s*,\s*)+/, $said->{body});
{
@a = split(/\bor\b/, $said->{body});
}
else
{
@a = split(/(?:\bor\b|\s*,\s*)+/, $said->{body});
}
s/^\s*//, s/\s*(\?\s*)?$// for @a; #trim them up s/^\s*//, s/\s*(\?\s*)?$// for @a; #trim them up