From: Ansgar Burchardt <ansgar@43-1.org>
Date: Thu, 05 Aug 2010 20:14:51 +0900
Origin: vendor
Bug-Debian: http://bugs.debian.org/591126
Forwarded: https://rt.cpan.org/Ticket/Display.html?id=59246
Subject: response_dumper needs to handle arrays as well

LWP::UserAgent::request is now called in list context. The wrapper then has
an arrayref in $_[-1] instead of an object and response_dumper needs to be
adjusted for this.
--- libwww-mechanize-shell-perl.orig/lib/WWW/Mechanize/Shell.pm
+++ libwww-mechanize-shell-perl/lib/WWW/Mechanize/Shell.pm
@@ -318,7 +318,13 @@
 };
 
 sub request_dumper { print $_[1]->as_string };
-sub response_dumper { print $_[1]->as_string };
+sub response_dumper {
+  if (ref $_[1] eq 'ARRAY') {
+    print $_[1]->[0]->as_string;
+  } else {
+    print $_[1]->as_string;
+  }
+};
 
 sub re_or_string {
   my ($self,$arg) = @_;
