[base] be less repetitive

master
Moritz Lenz 2012-04-16 03:31:26 +02:00
parent 055c7459e0
commit bb453fd6d4
1 changed files with 1 additions and 1 deletions

View File

@ -5,7 +5,6 @@ use warnings;
use Math::Int2Base qw/int2base/;
use DDG::Goodie;
triggers any => qw/hex hexadecimal octal oct binary base/;
zci answer_type => "conversion";
zci is_cached => 1;
my %base_map = (
@ -15,6 +14,7 @@ my %base_map = (
octal => 8,
binary => 2,
);
triggers any => 'base', keys %base_map;
handle query_clean => sub {
return unless /^([0-9]+)\s*(?:(?:in|as|to)\s+)?(hex|hexadecimal|octal|oct|binary|base\s*([0-9]+))$/;