about summary refs log tree commit
path: root/Net/Cmd.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Net/Cmd.pm')
-rw-r--r--Net/Cmd.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/Net/Cmd.pm b/Net/Cmd.pm
index 639a8a9..727b677 100644
--- a/Net/Cmd.pm
+++ b/Net/Cmd.pm
@@ -353,6 +353,7 @@ sub response {
     ($code, $more) = $cmd->parse_response($str);
     unless (defined $code) {
       $cmd->ungetline($str);
+      $@ = $str;   # $@ used as tunneling hack
       last;
     }
 
@@ -363,6 +364,7 @@ sub response {
     last unless ($more);
   }
 
+  return undef unless defined $code;
   substr($code, 0, 1);
 }