1This patch for WWW::Mechanize stops these warnings from appearing when using 2WWW::Myspace: 3 4 Parsing of undecoded UTF-8 will give garbage when decoding entities at 5 /usr/local/lib/perl/5.8.8/HTML/PullParser.pm line 83. 6 7It is not necessary to use this patch, but you may wish to use it if you want 8to stop those warnings from appearing. It is provided for your convenience but 9there is no guarantee it won't break functionality of other programs dependent 10on WWW::Mechanize. Use at your own risk! 11 12It can be applied against an extracted copy of the WWW::Mechanize distribution 13before testing and installing it, for example: 14 15 tar -zxvf WWW-Mechanize-1.34.tar.gz 16 cd WWW-Mechanize-1.34/ 17 patch -p1 < /path/to/WWW-Myspace/mechanize.patch 18 make 19 make test 20 sudo make install 21 22Alternatively, it can be applied to an already-installed copy of the module, 23as long as you know where to find it. If your all of your Perl modules are in 24/usr/share/perl5 (as is the case for Debian-packaged Perl modules), do the 25following: 26 27 cd /usr/share/perl5 28 sudo patch -p2 < /path/to/WWW-Myspace/mechanize.patch 29 30If you don't know where the module is installed, you can do the following to 31search for all installed versions of WWW::Mechanize and try to patch all of 32them (at your own risk) : 33 34 perl -e 'foreach $d (@INC) { print "$d\n" if ( $d =~ /^\// && -f "$d/WWW/Mechanize.pm" ); }' | while read d ; do cd "$d" && sudo patch --dry-run -p2 < /path/to/WWW-Myspace/mechanize.patch ; done 35 36Note that this patch was created against WWW::Mechanize version 1.34. The 37patch may fail to apply against later versions. Hopefully the problem will be 38fixed in WWW::Mechanize itself and there soon won't be any need to patch it. 39 40diff -Nru WWW-Mechanize-1.34.orig/lib/WWW/Mechanize.pm WWW-Mechanize-1.34/lib/WWW/Mechanize.pm 41--- WWW-Mechanize-1.34.orig/lib/WWW/Mechanize.pm 2008-08-17 02:59:35.000000000 +0100 42+++ WWW-Mechanize-1.34/lib/WWW/Mechanize.pm 2008-08-17 02:59:26.000000000 +0100 43@@ -2146,9 +2146,7 @@ 44 45 # Try to decode the content. Undef will be returned if there's nothing to decompress. 46 # See docs in HTTP::Message for details. Do we need to expose the options there? 47- # use charset => 'none' because while we want LWP to handle Content-Encoding for 48- # the auto-gzipping with Compress::Zlib we don't want it messing with charset 49- my $content = $res->decoded_content( charset => 'none' ); 50+ my $content = $res->decoded_content; 51 $content = $res->content if (not defined $content); 52 53 $content .= _taintedness(); 54