summary refs log tree commit diff
diff options
context:
space:
mode:
authorfranck cuny <franck@lumberjaph.net>2010-10-14 14:06:23 +0200
committerfranck cuny <franck@lumberjaph.net>2010-10-14 14:06:23 +0200
commitf06f451a762b200fe5598327e3419f3b4bad2011 (patch)
treee999108340e172843ba1d2cb0878d583556db4a5
parentuse utf8 (diff)
downloadnet-http-spore-f06f451a762b200fe5598327e3419f3b4bad2011.tar.gz
use Scalar::Utils to check if self is blessed
-rw-r--r--lib/Net/HTTP/Spore/Middleware.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Net/HTTP/Spore/Middleware.pm b/lib/Net/HTTP/Spore/Middleware.pm
index 2855a72..1b0d5d3 100644
--- a/lib/Net/HTTP/Spore/Middleware.pm
+++ b/lib/Net/HTTP/Spore/Middleware.pm
@@ -4,6 +4,7 @@ package Net::HTTP::Spore::Middleware;
 
 use strict;
 use warnings;
+use Scalar::Util;
 
 sub new {
     my $class = shift;
@@ -22,7 +23,7 @@ sub response_cb {
 sub wrap {
     my ($self, $cond, @args) = @_;
 
-    if (!ref $self) {
+    if (!Scalar::Util::blessed($self)) {
         $self = $self->new(@args);
     }