From: erickson Date: Sat, 12 Mar 2005 02:19:40 +0000 (+0000) Subject: added == to number X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=513c24f31f91dc5b888baf6f25f65866e090adf6;p=opensrf%2Fbjwebb.git added == to number git-svn-id: svn://svn.open-ils.org/OpenSRF/trunk@220 9efc2488-bf62-4759-914b-345cdb29e865 --- diff --git a/src/perlmods/JSON.pm b/src/perlmods/JSON.pm index 653b622..c878f86 100644 --- a/src/perlmods/JSON.pm +++ b/src/perlmods/JSON.pm @@ -13,6 +13,7 @@ use overload ( '/' => sub { int($_[0]) / int($_[1]) } ); use overload ( '%' => sub { int($_[0]) % int($_[1]) } ); use overload ( '**' => sub { int($_[0]) ** int($_[1]) } ); use overload ( 'neg' => sub { -int($_[0]) } ); +use overload ( '==' => sub { int($_[0]->toString) == int($_[1])} ); sub toString { defined($_[1]) ? ${$_[1]} : ${$_[0]} }