From: Florian Ragwitz Date: Sun, 8 Feb 2009 16:48:34 +0000 (+0000) Subject: Only use the imported version of Scalar::Util::blessed for consistency. X-Git-Tag: 5.80001~115 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=7e95ba12950606b1563751e907ef4ed1cdc9d2e2;hp=75d3bb653f60b685aaf9247364f7616830746b0d Only use the imported version of Scalar::Util::blessed for consistency. --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 7c25b1d..162c1bf 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -1110,7 +1110,7 @@ using C<< $c->req->captures >>. sub uri_for { my ( $c, $path, @args ) = @_; - if ( Scalar::Util::blessed($path) ) { # action object + if ( blessed($path) ) { # action object my $captures = ( scalar @args && ref $args[0] eq 'ARRAY' ? shift(@args) : [] ); diff --git a/lib/Catalyst/Dispatcher.pm b/lib/Catalyst/Dispatcher.pm index b0b3606..edf194a 100644 --- a/lib/Catalyst/Dispatcher.pm +++ b/lib/Catalyst/Dispatcher.pm @@ -147,7 +147,7 @@ sub _command2action { # go to a string path ("/foo/bar/gorch") # or action object - if (Scalar::Util::blessed($command) && $command->isa('Catalyst::Action')) { + if (blessed($command) && $command->isa('Catalyst::Action')) { $action = $command; } else { @@ -666,7 +666,7 @@ foreach my $public_method_name (qw/ my %package_hash; # Only warn once per method, per package. These are infrequent enough that # I haven't provided a way to disable them, patches welcome. $meta->add_before_method_modifier($public_method_name, sub { - my $class = Scalar::Util::blessed(shift); + my $class = blessed(shift); $package_hash{$class}++ || do { warn("Class $class is calling the deprecated method Catalyst::Dispatcher::$public_method_name,\n" . "this will be removed in Catalyst 5.9X"); diff --git a/lib/Catalyst/Engine.pm b/lib/Catalyst/Engine.pm index 45b1c7b..ad2a180 100644 --- a/lib/Catalyst/Engine.pm +++ b/lib/Catalyst/Engine.pm @@ -46,7 +46,7 @@ sub finalize_body { my ( $self, $c ) = @_; my $body = $c->response->body; no warnings 'uninitialized'; - if ( Scalar::Util::blessed($body) && $body->can('read') or ref($body) eq 'GLOB' ) { + if ( blessed($body) && $body->can('read') or ref($body) eq 'GLOB' ) { while ( !eof $body ) { read $body, my ($buffer), $CHUNKSIZE; last unless $self->write( $c, $buffer ); @@ -76,7 +76,7 @@ sub finalize_cookies { my $val = $response->cookies->{$name}; my $cookie = ( - Scalar::Util::blessed($val) + blessed($val) ? $val : CGI::Simple::Cookie->new( -name => $name,