X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FUtils.pm;h=9cb0eb6db0e265bc685c3c40ccf3f210799f56b7;hp=9fb1e920b28f0be5b60b72a4eb07c176cea7ff56;hb=dd4530ecdc4684838d9c0e9dc00adebb6100b022;hpb=e58865461d2d7c80b8136a4b853082cb8031975e diff --git a/lib/Catalyst/Utils.pm b/lib/Catalyst/Utils.pm index 9fb1e92..9cb0eb6 100644 --- a/lib/Catalyst/Utils.pm +++ b/lib/Catalyst/Utils.pm @@ -13,6 +13,7 @@ use Class::Load (); use namespace::clean; use Devel::InnerPackage; use Moose::Util; +use Ref::Util qw(is_plain_hashref); =head1 NAME @@ -331,8 +332,8 @@ sub merge_hashes { my %merged = %$lefthash; for my $key ( keys %$righthash ) { - my $right_ref = ( ref $righthash->{ $key } || '' ) eq 'HASH'; - my $left_ref = ( ( exists $lefthash->{ $key } && ref $lefthash->{ $key } ) || '' ) eq 'HASH'; + my $right_ref = is_plain_hashref( $righthash->{ $key } ); + my $left_ref = exists $lefthash->{ $key } && is_plain_hashref( $lefthash->{ $key } ); if( $right_ref and $left_ref ) { $merged{ $key } = merge_hashes( $lefthash->{ $key }, $righthash->{ $key }