From 326e25d1ad3df29e1a0758f2b654c54f8bea8515 Mon Sep 17 00:00:00 2001
From: Andrew Yates <ayates@ebi.ac.uk>
Date: Mon, 8 Oct 2012 10:25:09 +0000
Subject: [PATCH] [ENSCORESW-270]. Fixed issue with can() call which was
 returning a boolean flag rather than the coderef can() actually returns.
 Switched to local variables and the entire thing looks fine now

---
 modules/Bio/EnsEMBL/Utils/Proxy.pm | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/modules/Bio/EnsEMBL/Utils/Proxy.pm b/modules/Bio/EnsEMBL/Utils/Proxy.pm
index 51ff03436a..cc11f97574 100644
--- a/modules/Bio/EnsEMBL/Utils/Proxy.pm
+++ b/modules/Bio/EnsEMBL/Utils/Proxy.pm
@@ -135,9 +135,11 @@ sub isa {
 
 sub can {
   my ($self, $method) = @_;
-  return 1 if $self->SUPER::can($method);
-  return 1 if $self->__proxy()->can($method);
-  return 0;
+  my $super_can = $self->SUPER::can($method);
+  return $super_can if $super_can;
+  my $proxy_can = $self->__proxy()->can($method);
+  return $proxy_can if $proxy_can;
+  return;
 }
 
 =head2 DESTROY
-- 
GitLab