From baee8499414d2b8f896fc346fdc832c6fa864e15 Mon Sep 17 00:00:00 2001 From: Brad Steinbacher Date: Sun, 17 Feb 2013 20:26:45 -0500 Subject: [PATCH] bad input fix --- lib/DDG/Goodie/AnagramSolver.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/DDG/Goodie/AnagramSolver.pm b/lib/DDG/Goodie/AnagramSolver.pm index d2221af6f..92ace3514 100644 --- a/lib/DDG/Goodie/AnagramSolver.pm +++ b/lib/DDG/Goodie/AnagramSolver.pm @@ -6,6 +6,8 @@ use DDG::Goodie; triggers start => "flargblarg"; handle remainder => sub { + # maybe just split input and then test for validity + # to make it more robust /^\s*([a-zA-Z]+)\s*([0-9]+)\s*$/; my $word = 0; $word = lc($1) if $1;