From: Arthur Axel "fREW" Schmidt Date: Sun, 12 Sep 2010 19:39:58 +0000 (+0000) Subject: use object interface to Hash::Merge X-Git-Tag: v1.70~61 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bc4820853ac72f9a564e40f7b8fbe76d05c8cbbd;p=dbsrgits%2FSQL-Abstract.git use object interface to Hash::Merge --- diff --git a/lib/SQL/Abstract/Tree.pm b/lib/SQL/Abstract/Tree.pm index dcf9daf..c5abe28 100644 --- a/lib/SQL/Abstract/Tree.pm +++ b/lib/SQL/Abstract/Tree.pm @@ -5,9 +5,11 @@ use warnings; use Carp; use List::Util; -use Hash::Merge 'merge'; +use Hash::Merge; -Hash::Merge::specify_behavior({ +my $merger = Hash::Merge->new; + +$merger->specify_behavior({ SCALAR => { SCALAR => sub { $_[1] }, ARRAY => sub { [ $_[0], @{$_[1]} ] }, @@ -193,7 +195,7 @@ sub new { my $args = shift || {}; my $profile = delete $args->{profile} || 'none'; - my $data = merge( $profiles{$profile}, $args ); + my $data = $merger->merge( $profiles{$profile}, $args ); bless $data, $class }