[PATCH] XML::Compile::SOAP on Perl 5.6.1

Toby Corkindale tjc at wintrmute.net
Thu Sep 11 02:38:25 BST 2008


Hi,
The attached patches to Log::Report and XML::Compile::SOAP are enough to get it
functional on Perl 5.6, despite the normal requirements for Perl 5.8.

It's horrible so I'm not sure you'd *want* to include this in the main distro,
but I thought I'd send it along in case it ever becomes useful for someone else
who has to backport an application to a godforsaken ancient non-Linux, non-5.8
production system.  :)

BTW, aside from the locale and Encode bits, I noticed that
HTTP::Response->decoded_content() returns undef (rather than an error, or
content) on Perl 5.6 for no apparent reason. I'm sure that can't be right?
I don't have a lot of motivation to look into it right now though.. and the
versions of modules I'm hitting are all far enough away from current versions
so it's probably not worth it.

Cheers,
Toby

-- 
Turning and turning in the widening gyre/The falcon cannot hear the falconer;
Things fall apart, the centre cannot hold/Mere anarchy is loosed upon the world
(gpg --recv-key B1CCF88E)
-------------- next part --------------
Index: XML/Compile/Transport/SOAPHTTP.pm
===================================================================
RCS file: /web/src/rsearch/vendor/soap/XML/Compile/Transport/Attic/SOAPHTTP.pm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -r1.1.2.1 -r1.1.2.2
23c23,37
< use Encode;
---
> # Commenting out use of Encode, since it doesn't exist on Perl 5.6.1 on prod!
> # use Encode;
> if ($] >= 5.008) {
>     require Encode;
>     Encode->import;
> }
> # This function works around the lack of Encode on Perl 5.6 by.. not encoding
> # anything. Luckily, StreetAdvisor only sends us ASCII data anyway...
> sub questionableEncode {
>     my ($encoding, $string) = @_;
>     if ($] >= 5.008) {
>         return encode($encoding, $string);
>     }
>     return $string;
> }
123c137
<         my $u = encode($charset, $_[0]);
---
>         my $u = questionableEncode($charset, $_[0]);
146c160
<         my $u = encode($charset, $_[0]);
---
>         my $u = questionableEncode($charset, $_[0]);
157,159c171,177
<           $response->content_type =~ m![/+]xml$!i
<         ? $response->decoded_content
<         : undef;
---
>         if ($response->content_type =~ m![/+]xml$!i) {
>             if ($] >= 5.008) {
>                 return $response->decoded_content;
>             }
>             return $response->content;
>         }
>         return undef;
-------------- next part --------------
Index: Log/Report/Translator/POT.pm
===================================================================
RCS file: /web/src/rsearch/vendor/soap/Log/Report/Translator/Attic/POT.pm,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -r1.1.2.1 -r1.1.2.2
33c33
<     my $locale = setlocale(LC_MESSAGES)
---
>     my $locale = setlocale(&POSIX::LC_MESSAGES)


More information about the london.pm mailing list