Skip Menu |
 

This queue is for tickets about the SOAP-Lite CPAN distribution.

Report information
The Basics
Id: 52015
Status: resolved
Priority: 0/
Queue: SOAP-Lite

People
Owner: Nobody in particular
Requestors: IKEGAMI [...] cpan.org
wyant [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in: 0.710.10
Fixed in: (no value)



Subject: defined(%hash) deprecated in Perl 5.11
Download (untitled) / with headers
text/plain 812b
When run under Perl 5.11.2, many tests emit messages like the following: defined(%hash) is deprecated at /usr/local/perl/5.11.2/lib/site_per/5.11.2/SOAP/Lite.pm line 2204. (Maybe you should just omit the defined()?) I have marked this 'unimportant' because the tests pass and SOAP::Lite works, and because Perl 5.11 is a development release. I believe the warning signals an intent to do something similar in Perl 5.12, but whether the warning actually makes it to 5.12 is another thing entirely. The attached patch suppresses the deprecation warnings when applied against lib/SOAP/Lite.pm version 0.710.10. The test is still a bit noisy (mostly undef warnings) but that's a separate issue. Of course, what's really needed is a module that tests whether a namespace has been loaded. But I don't know of one.
Subject: SOAP-Lite.patch
Download SOAP-Lite.patch
text/x-diff 680b
--- lib/SOAP/Lite.old 2009-11-23 17:45:34.000000000 -0500 +++ lib/SOAP/Lite.pm 2009-11-23 17:45:45.000000000 -0500 @@ -462,7 +462,7 @@ (my $protocol_class = "${class}::$protocol") =~ s/-/_/g; no strict 'refs'; - unless (defined %{"$protocol_class\::Client::"} + unless ( %{"$protocol_class\::Client::"} && UNIVERSAL::can("$protocol_class\::Client" => 'new') ) { eval "require $protocol_class"; @@ -2201,7 +2201,7 @@ { no strict qw(refs); - if (! defined(%{"${schemaclass}::"}) ) { + if (! %{"${schemaclass}::"} ) { eval "require $schemaclass" or die $@ if not ref $schemaclass; } }
Download (untitled) / with headers
text/plain 1.3k
On Mon Nov 23 17:54:24 2009, WYANT wrote: Show quoted text
> When run under Perl 5.11.2, many tests emit messages like the following: > > defined(%hash) is deprecated at > /usr/local/perl/5.11.2/lib/site_per/5.11.2/SOAP/Lite.pm line 2204. > (Maybe you should just omit the defined()?) > > I have marked this 'unimportant' because the tests pass and SOAP::Lite > works, and because Perl 5.11 is a development release. I believe the > warning signals an intent to do something similar in Perl 5.12, but > whether the warning actually makes it to 5.12 is another thing entirely. > > The attached patch suppresses the deprecation warnings when applied > against lib/SOAP/Lite.pm version 0.710.10. The test is still a bit noisy > (mostly undef warnings) but that's a separate issue. > > Of course, what's really needed is a module that tests whether a > namespace has been loaded. But I don't know of one.
Hello, I am the author of POE::Component::Server::SOAP and this bit me today. A CPANTesters report showed that 5.12.0-RC0 still had this warning enabled. It would be nice if this could be patched so we have a warning-free load :) Again, great work on such an excellent SOAP library! http://www.cpantesters.org/cpan/report/6998891 # My module's report http://www.cpantesters.org/cpan/report/7001861 # SOAP::Lite's report -- ~Apocalypse
Download (untitled) / with headers
text/plain 351b
PS - I thought I had seen a module that tested if a namespace had been loaded, and I had: Adam Kennedy's Class::Inspector has a loaded() method that does this. If that's really what the checks of %Foo::Bar:: are about, and you don't want to roll your own, this might do the job. It appears to be very lightweight as far as dependencies go. Tom Wyant
Subject: defined(%hash) deprecated in Perl 5.12
From: Mike B.
On Mon Nov 23 17:54:24 2009, WYANT wrote: Show quoted text
> I have marked this 'unimportant' because the tests pass and SOAP::Lite > works, and because Perl 5.11 is a development release. I believe the > warning signals an intent to do something similar in Perl 5.12, but > whether the warning actually makes it to 5.12 is another thing entirely. > > The attached patch suppresses the deprecation warnings when applied > against lib/SOAP/Lite.pm version 0.710.10. The test is still a bit noisy > (mostly undef warnings) but that's a separate issue.
Well, of course 5.12 is out, and the behavior of warning is here to stay. I have a script to check what versions of modules are installed, and it does this: defined(%hash) is deprecated at C:/strawberry/perl/vendor/lib/SOAP/Lite.pm line 465. (Maybe you should just omit the defined()?) defined(%hash) is deprecated at C:/strawberry/perl/vendor/lib/SOAP/Lite.pm line 2203. (Maybe you should just omit the defined()?) o SOAP::Lite.....................ok (v0.711) So I guess it would be nice if this can be addressed in an upcoming version of SOAP::Lite.
Download (untitled) / with headers
text/plain 715b
On Thu Mar 25 23:09:21 2010, WYANT wrote: Show quoted text
> PS - > > I thought I had seen a module that tested if a namespace had been > loaded, and I had: Adam Kennedy's Class::Inspector has a loaded() method > that does this. If that's really what the checks of %Foo::Bar:: are > about, and you don't want to roll your own, this might do the job. It > appears to be very lightweight as far as dependencies go. > > Tom Wyant
The fix is much simpler $ perl -wle' sub Foo::foo; print defined(%{"$_\::"}) ?1:0 for qw( Foo Bar ); ' defined(%hash) is deprecated at -e line 3. (Maybe you should just omit the defined()?) 1 0 $ perl -wle' sub Foo::foo; print %{"$_\::"} ?1:0 for qw( Foo Bar ); ' 1 0
Patch against version 0.711 attached.
Subject: defined_hash_warn.patch
--- Lite.pm 2010-05-05 16:58:51.000000000 -0400 +++ Lite.new.pm 2010-05-05 17:02:54.000000000 -0400 @@ -461,7 +461,7 @@ (my $protocol_class = "${class}::$protocol") =~ s/-/_/g; no strict 'refs'; - unless (defined %{"$protocol_class\::Client::"} + unless (%{"$protocol_class\::Client::"} && UNIVERSAL::can("$protocol_class\::Client" => 'new') ) { eval "require $protocol_class"; @@ -2200,7 +2200,7 @@ { no strict qw(refs); - if (! defined(%{"${schemaclass}::"}) ) { + if (! %{"${schemaclass}::"} ) { eval "require $schemaclass" or die $@ if not ref $schemaclass; } }
Subject: Re: [rt.cpan.org #52015] defined(%hash) deprecated in Perl 5.11
Date: Fri, 07 May 2010 17:36:16 +0200
To: bug-SOAP-Lite [...] rt.cpan.org
From: Martin Kutter <martin.kutter [...] fen-net.de>
Hi, this is already fixed in SVN - I used Class::Inspector. Martin
fixed in >= 0.713


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.