From: Matt S Trout Date: Sun, 12 Aug 2012 10:58:16 +0000 (+0000) Subject: remove pointless overloads X-Git-Tag: v1.000000~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5963e05e592c11b68209decb62a44bfb1375a7ab;p=scpubgit%2FHTML-String.git remove pointless overloads --- diff --git a/lib/HTML/String/Value.pm b/lib/HTML/String/Value.pm index 99a1284..97c80fa 100644 --- a/lib/HTML/String/Value.pm +++ b/lib/HTML/String/Value.pm @@ -5,40 +5,12 @@ use UNIVERSAL::ref; use Safe::Isa; use Data::Munge; -sub op_factory { - my ($op) = @_; - - return eval q|sub { - my ($self, $str) = @_; - - if ( $str->$_isa(__PACKAGE__) ) { - return $self->unescaped_string | . $op . q| $str->unescaped_string; - } - else { - return $self->unescaped_string | . $op . q| $str; - } - }|; -} - use overload '""' => 'escaped_string', '.' => 'dot', '.=' => 'dot_equals', '=' => 'clone', - 'cmp' => op_factory('cmp'), - 'eq' => op_factory('eq'), - '<=>' => op_factory('<=>'), - '==' => op_factory('=='), - '%' => op_factory('%'), - '+' => op_factory('+'), - '-' => op_factory('-'), - '*' => op_factory('*'), - '/' => op_factory('/'), - '**' => op_factory('**'), - '>>' => op_factory('>>'), - '<<' => op_factory('<<'), - fallback => 1, ;