X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FMoose%2FUtil.pm;h=b03caa5d17e30ef4f45ff2e8e97ed1d2c5b72e27;hb=a917d5ae83dc260c6a84fed0ffdc0d1b70c50266;hp=8b4c34f0a1662b42d7b07a83bf2086b958151314;hpb=a9f50e21a1107a444935e5d8c3a38e466d8d2968;p=gitmo%2FMoose.git diff --git a/lib/Moose/Util.pm b/lib/Moose/Util.pm index 8b4c34f..b03caa5 100644 --- a/lib/Moose/Util.pm +++ b/lib/Moose/Util.pm @@ -279,7 +279,7 @@ sub _caller_info { my $level = @_ ? ($_[0] + 1) : 2; my %info; @info{qw(package file line)} = caller($level); - return \%info; + return %info; } sub _create_alias { @@ -308,12 +308,14 @@ sub meta_class_alias { # XXX - this should be added to Params::Util sub _STRINGLIKE0 ($) { - return _STRING( $_[0] ) - || ( defined $_[0] - && $_[0] eq q{} ) - || ( blessed $_[0] - && overload::Method( $_[0], q{""} ) - && length "$_[0]" ); + return 1 if _STRING( $_[0] ); + if ( blessed $_[0] ) { + return overload::Method( $_[0], q{""} ); + } + + return 1 if defined $_[0] && $_[0] eq q{}; + + return 0; } sub _reconcile_roles_for_metaclass {