Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Data-Util CPAN distribution.

Report information
The Basics
Id: 99097
Status: resolved
Priority: 0/
Queue: Data-Util

People
Owner: Nobody in particular
Requestors: 'spro^^*%*^6ut# [...] &$%*c
Cc: ether [...] cpan.org
AdminCc:

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



Subject: [PATCH] Fix for 5.21.4
Stashes can now have sub refs in them. See the attached patch.
Subject: open_4mpiMXrc.txt
diff -rup Data-Util-0.63-eMJzy2-orig/DataUtil.xs Data-Util-0.63-eMJzy2/DataUtil.xs --- Data-Util-0.63-eMJzy2-orig/DataUtil.xs 2013-04-03 00:06:08.000000000 -0700 +++ Data-Util-0.63-eMJzy2/DataUtil.xs 2014-09-23 18:48:48.000000000 -0700 @@ -674,7 +674,14 @@ my_uninstall_sub(pTHX_ HV* const stash, CV* code; if(!isGV(gv)){ /* a subroutine stub or special constant*/ - if(SvROK((SV*)gv) && ckWARN(WARN_MISC)){ + /* or perhaps a sub ref */ + if(SvROK((SV*)gv)) { + if(SvTYPE(SvRV(gv)) == SVt_PVCV) { + if( specified_code && + specified_code != (CV*)SvRV(gv) ) + return; + } + else if(ckWARN(WARN_MISC)) Perl_warner(aTHX_ packWARN(WARN_MISC), "Constant subroutine %s uninstalled", name); } (void)hv_delete(stash, name, namelen, G_DISCARD); diff -rup Data-Util-0.63-eMJzy2-orig/lib/Data/Util/PurePerl.pm Data-Util-0.63-eMJzy2/lib/Data/Util/PurePerl.pm --- Data-Util-0.63-eMJzy2-orig/lib/Data/Util/PurePerl.pm 2012-10-20 04:54:44.000000000 -0700 +++ Data-Util-0.63-eMJzy2/lib/Data/Util/PurePerl.pm 2014-09-23 18:44:36.000000000 -0700 @@ -246,8 +246,16 @@ sub uninstall_subroutine { my $glob = $stash->{$name}; if(ref(\$glob) ne 'GLOB'){ - if(ref $glob){ + if(ref $glob) { + if(Scalar::Util::reftype $glob eq 'CODE'){ + if(defined $specified_code && + $specified_code != $glob) { + next; + } + } + else { warnings::warnif(misc => "Constant subroutine $name uninstalled"); + } } delete $stash->{$name}; next;
On 2014-09-23 21:56:55, SPROUT wrote: Show quoted text
> Stashes can now have sub refs in them. See the attached patch.
Still fails with 5.21.7, but the attached patch still works.
On 2014-12-20 16:37:50, SREZIC wrote: Show quoted text
> On 2014-09-23 21:56:55, SPROUT wrote:
> > Stashes can now have sub refs in them. See the attached patch.
> > Still fails with 5.21.7, but the attached patch still works.
The patch still works with 5.21.8.
On 2015-01-20 16:38:54, SREZIC wrote: Show quoted text
> On 2014-12-20 16:37:50, SREZIC wrote:
> > On 2014-09-23 21:56:55, SPROUT wrote:
> > > Stashes can now have sub refs in them. See the attached patch.
> > > > Still fails with 5.21.7, but the attached patch still works.
> > The patch still works with 5.21.8.
The patch still works with 5.21.9. Note that stable perl 5.22 will be released soon (in two months or so).
On 2015-02-26 02:22:33, SREZIC wrote: Show quoted text
> On 2015-01-20 16:38:54, SREZIC wrote:
> > On 2014-12-20 16:37:50, SREZIC wrote:
> > > On 2014-09-23 21:56:55, SPROUT wrote:
> > > > Stashes can now have sub refs in them. See the attached patch.
> > > > > > Still fails with 5.21.7, but the attached patch still works.
> > > > The patch still works with 5.21.8.
> > The patch still works with 5.21.9. Note that stable perl 5.22 will be > released soon (in two months or so).
The patch still works with 5.21.10.
On 2015-03-20 16:15:55, SREZIC wrote: Show quoted text
> On 2015-02-26 02:22:33, SREZIC wrote:
> > On 2015-01-20 16:38:54, SREZIC wrote:
> > > On 2014-12-20 16:37:50, SREZIC wrote:
> > > > On 2014-09-23 21:56:55, SPROUT wrote:
> > > > > Stashes can now have sub refs in them. See the attached patch.
> > > > > > > > Still fails with 5.21.7, but the attached patch still works.
> > > > > > The patch still works with 5.21.8.
> > > > The patch still works with 5.21.9. Note that stable perl 5.22 will be > > released soon (in two months or so).
> > The patch still works with 5.21.10.
And with 5.21.11.
On 2015-04-20 18:48:10, SREZIC wrote: Show quoted text
> On 2015-03-20 16:15:55, SREZIC wrote:
> > On 2015-02-26 02:22:33, SREZIC wrote:
> > > On 2015-01-20 16:38:54, SREZIC wrote:
> > > > On 2014-12-20 16:37:50, SREZIC wrote:
> > > > > On 2014-09-23 21:56:55, SPROUT wrote:
> > > > > > Stashes can now have sub refs in them. See the attached patch.
> > > > > > > > > > Still fails with 5.21.7, but the attached patch still works.
> > > > > > > > The patch still works with 5.21.8.
> > > > > > The patch still works with 5.21.9. Note that stable perl 5.22 will be > > > released soon (in two months or so).
> > > > The patch still works with 5.21.10.
> > And with 5.21.11.
The patch works also with perl 5.22.x and 5.23.x (just tried with 5.23.5).
On 2015-11-24 02:43:00, SREZIC wrote: Show quoted text
> On 2015-04-20 18:48:10, SREZIC wrote:
> > On 2015-03-20 16:15:55, SREZIC wrote:
> > > On 2015-02-26 02:22:33, SREZIC wrote:
> > > > On 2015-01-20 16:38:54, SREZIC wrote:
> > > > > On 2014-12-20 16:37:50, SREZIC wrote:
> > > > > > On 2014-09-23 21:56:55, SPROUT wrote:
> > > > > > > Stashes can now have sub refs in them. See the attached patch.
> > > > > > > > > > > > Still fails with 5.21.7, but the attached patch still works.
> > > > > > > > > > The patch still works with 5.21.8.
> > > > > > > > The patch still works with 5.21.9. Note that stable perl 5.22 will be > > > > released soon (in two months or so).
> > > > > > The patch still works with 5.21.10.
> > > > And with 5.21.11.
> > The patch works also with perl 5.22.x and 5.23.x (just tried with 5.23.5). >
The patch also works with perl 5.24.0 and 5.25.1.
Thanks for patch. I applied it. And release version 0.64. Please upgrade.