diff options
author | franck cuny <franck@lumberjaph.net> | 2010-10-14 14:06:23 +0200 |
---|---|---|
committer | franck cuny <franck@lumberjaph.net> | 2010-10-14 14:06:23 +0200 |
commit | f06f451a762b200fe5598327e3419f3b4bad2011 (patch) | |
tree | e999108340e172843ba1d2cb0878d583556db4a5 | |
parent | use utf8 (diff) | |
download | net-http-spore-f06f451a762b200fe5598327e3419f3b4bad2011.tar.gz |
use Scalar::Utils to check if self is blessed
-rw-r--r-- | lib/Net/HTTP/Spore/Middleware.pm | 3 |
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); } |