Skip Menu |

This queue is for tickets about the Iterator-Simple CPAN distribution.

Report information
The Basics
Id: 60352
Status: resolved
Priority: 0/
Queue: Iterator-Simple

People
Owner: wftk [...] vivtek.com
Requestors: user42 [...] zip.com.au
Cc:
AdminCc:

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



Subject: UNIVERSAL isa() function import
Date: Sun, 15 Aug 2010 10:32:01 +1000
To: bug-Iterator-Simple [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
Perl 5.14.0 or something is supposedly going to break compatibility with existing code which does an import of UNIVERSAL::isa() like use UNIVERSAL qw(isa); which is in Iterator::Simple. Perl 5.12.0 gives a warn() about this (no doubt because it's thought better to spam a million users than it is to report to authors of affected code :-(. I suppose calling isa() as a function is not how it's meant to be used, or maybe it started out that way but no longer. I can't tell quite what Iterator::Simple might want, perhaps Scalar::Util::blessed() followed by $rv->isa(...) ... (though I'm always a bit wary of code that enquires too much into the nature of its args).
From: chip [...] pobox.com
Patch attached. Please fix!
Subject: Iterator-Simple-0.051.diff
diff -ru ../Iterator-Simple-0.05/lib/Iterator/Simple.pm ./lib/Iterator/Simple.pm --- ../Iterator-Simple-0.05/lib/Iterator/Simple.pm 2008-03-26 23:54:13.000000000 -0700 +++ ./lib/Iterator/Simple.pm 2011-08-29 15:49:17.454522735 -0700 @@ -3,14 +3,13 @@ use strict; use Carp; -use UNIVERSAL qw(isa); use Scalar::Util qw(blessed reftype); use overload; use base qw(Exporter); use vars qw($VERSION @EXPORT_OK %EXPORT_TAGS); use constant ITERATOR_CLASS => 'Iterator::Simple::Iterator'; -$VERSION = '0.05'; +$VERSION = '0.0501'; $EXPORT_TAGS{basic} = [qw(iterator iter list is_iterator)]; $EXPORT_TAGS{utils} = [qw( @@ -167,7 +166,7 @@ } while(defined(local $_ = $src->())) { next unless defined($rv = $code->()); - return $rv unless isa $rv, ITERATOR_CLASS; + return $rv unless UNIVERSAL::isa $rv, ITERATOR_CLASS; $buf = $rv; return $rv if defined($rv = $buf->()); undef $buf; @@ -232,7 +231,7 @@ while(1){ $rv = $src->(); return if not defined $rv; - return $rv unless isa $rv, ITERATOR_CLASS; + return $rv unless UNIVERSAL::isa $rv, ITERATOR_CLASS; $buf = $rv; return $rv if defined($rv = $buf->()); undef $buf;
Subject: Re: [rt.cpan.org #60352] UNIVERSAL isa() function import
Date: Wed, 31 Aug 2011 09:09:47 +1000
To: bug-Iterator-Simple [...] rt.cpan.org
From: Kevin Ryde <user42 [...] zip.com.au>
"Chip Salzenberg via RT" <bug-Iterator-Simple@rt.cpan.org> writes: Show quoted text
> > - return $rv unless isa $rv, ITERATOR_CLASS; > + return $rv unless UNIVERSAL::isa $rv, ITERATOR_CLASS;
I had thought isa as a method like (untested) blessed($rv) && $rv->isa(WHATEVER) or whatever it is that's usual like that (from Scalar::Util or whatever). I believe that sort of thing is so a class can make an isa() doing fancy things if it really wants (the occasional lazy object or stuff like that). -- The sigfile movie review series: "Snakes on a Plane" -- modern dress retelling of the panic aboard a ship of King Eumenes II's fleet attacked by Hannibal with jars of poisonous snakes.
From: chip [...] pobox.com
On Tue Aug 30 19:10:16 2011, user42@zip.com.au wrote: Show quoted text
> "Chip Salzenberg via RT" <bug-Iterator-Simple@rt.cpan.org> writes:
> > > > - return $rv unless isa $rv, ITERATOR_CLASS; > > + return $rv unless UNIVERSAL::isa $rv,
ITERATOR_CLASS; Show quoted text
> > I had thought isa as a method like (untested) > blessed($rv) && $rv->isa(WHATEVER) > or whatever it is that's usual like that (from Scalar::Util or > whatever).
That is more correct, yes. I don't know the in question module very well, so I didn't want to assume that would fit the design.
Subject: UNIVERSAL isa() function import - github fix
I've pre-made all the changes necessary to eliminate this problem in a Github repository at: https://github.com/Vivtek/Iterator-Simple I have several codebases that depend on this fantastic module and would love to see this resolved. Thanks!
Fixed in 0.06.