Skip Menu |

This queue is for tickets about the Devel-Cycle CPAN distribution.

Report information
The Basics
Id: 56681
Status: open
Priority: 0/
Queue: Devel-Cycle

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

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



Subject: Unhandled type: REGEXP at ...Devel/Cycle.pm line 107 under Perl 5.12.0.
Under Perl 5.12.0: $ perl -MDevel::Cycle -e 'my $foo = qr{bar}smx; find_cycle($foo)' Unhandled type: REGEXP at /usr/local/perl/5.12.0/lib/site_perl/5.12.0/Devel/Cycle.pm line 107. This appears to be because regular expressions have become first-class objects under 5.12, so UNIVERSAL::isa($thingy,'SCALAR'), which was true under 5.10 when $thingy contained a reference to a regexp, is false under 5.12. The attached patches against 1.11 restore the 5.10 behavior under 5.12, by having _get_type() return 'SCALAR' when UNIVERSAL::isa($thingy,'Regexp') is true, and test the handling of regexps. The patches test without reporting any errors under both 5.10.1 and 5.12.0
Subject: Devel-Cycle-pm.patch
--- lib/Devel/Cycle.old 2009-08-24 08:54:45.000000000 -0400 +++ lib/Devel/Cycle.pm 2010-04-16 20:53:30.000000000 -0400 @@ -215,7 +215,7 @@ sub _get_type { my $thingy = shift; return unless ref $thingy; - return 'SCALAR' if UNIVERSAL::isa($thingy,'SCALAR') || UNIVERSAL::isa($thingy,'REF'); + return 'SCALAR' if UNIVERSAL::isa($thingy,'SCALAR') || UNIVERSAL::isa($thingy,'REF') || UNIVERSAL::isa($thingy,'Regexp'); return 'ARRAY' if UNIVERSAL::isa($thingy,'ARRAY'); return 'HASH' if UNIVERSAL::isa($thingy,'HASH'); return 'CODE' if UNIVERSAL::isa($thingy,'CODE');
Subject: Devel-Cycle-t.patch
--- t/Devel-Cycle.old 2008-07-08 21:26:35.000000000 -0400 +++ t/Devel-Cycle.t 2010-04-16 20:39:04.000000000 -0400 @@ -5,7 +5,7 @@ # change 'tests => 1' to 'tests => last_test_to_print'; -use Test::More tests => 12; +use Test::More tests => 13; use Scalar::Util qw(weaken isweak); BEGIN { use_ok('Devel::Cycle') }; @@ -87,6 +87,7 @@ } { + no warnings qw{ once }; *FOOBAR = *FOOBAR if 0; # cease -w my $test2 = { glob => \*FOOBAR }; @@ -101,6 +102,15 @@ is("@warnings", "", "Warn only once"); } +{ + my $test_re = qr{foo}xms; + + my @warnings; + local $SIG{__WARN__} = sub { push @warnings, @_ }; + find_cycle($test_re); + ok( !@warnings, 'No warnings on Regex' ); +} + package foo; use overload q("") => sub{ return 1 }; # show false alarm
RT-Send-CC: modules [...] perl.org, lincoln.stein [...] gmail.com
On Fri Apr 16 21:01:50 2010, WYANT wrote: Show quoted text
> Under Perl 5.12.0: > > $ perl -MDevel::Cycle -e 'my $foo = qr{bar}smx; find_cycle($foo)' > Unhandled type: REGEXP at > /usr/local/perl/5.12.0/lib/site_perl/5.12.0/Devel/Cycle.pm line 107. > > This appears to be because regular expressions have become first-class > objects under 5.12, so UNIVERSAL::isa($thingy,'SCALAR'), which was true > under 5.10 when $thingy contained a reference to a regexp, is false > under 5.12. > > The attached patches against 1.11 restore the 5.10 behavior under 5.12, > by having _get_type() return 'SCALAR' when > UNIVERSAL::isa($thingy,'Regexp') is true, and test the handling of > regexps. The patches test without reporting any errors under both 5.10.1 > and 5.12.0
It has been almost 9 months since this bug was filed. Any chance of another release of Devel::Cycle?
RT-Send-CC: modules [...] perl.org, lincoln.stein [...] gmail.com
I have similar issues with "Unhandled type: GLOB".
This family of bugs will be fixed over the next few days after I transition the source code from CVS to git.
RT-Send-CC: modules [...] perl.org, lincoln.stein [...] gmail.com
On Fri Apr 16 18:01:50 2010, WYANT wrote: Show quoted text
> This appears to be because regular expressions have become first-class > objects under 5.12, so UNIVERSAL::isa($thingy,'SCALAR'), which was true > under 5.10 when $thingy contained a reference to a regexp, is false > under 5.12.
It is not valid to use UNIVERSAL::isa in this way: 1. isa is only a (object or class) method, not a function - it must have an invocant 2. isa should only properly be used for class names or blessed objects, not for base types -- to check the base type of a reference, use Scalar::Util::reftype. Is the repository in git yet? If so, I can provide patches. thank you!
On Wed Oct 24 13:19:40 2012, LDS wrote: Show quoted text
> This family of bugs will be fixed over the next few days after I > transition the source code from CVS to git.
I'd love to see this fixed, and I'll even be happy to help.
On Sun Nov 03 13:41:16 2013, KSTAR wrote: Show quoted text
> On Wed Oct 24 13:19:40 2012, LDS wrote:
> > This family of bugs will be fixed over the next few days after I > > transition the source code from CVS to git.
> > I'd love to see this fixed, and I'll even be happy to help.
Bump!
Subject: Re: [rt.cpan.org #56681] Unhandled type: REGEXP at ...Devel/Cycle.pm line 107 under Perl 5.12.0.
Date: Thu, 13 Nov 2014 14:56:11 -0800
To: Olaf Alders via RT <bug-Devel-Cycle [...] rt.cpan.org>
From: Karen Etheridge <ether [...] cpan.org>
On Thu, Nov 13, 2014 at 05:40:50PM -0500, Olaf Alders via RT wrote: Show quoted text
> > I'd love to see this fixed, and I'll even be happy to help.
> > Bump!
*awakens from slumber, finds that someone gave me comaint* :)
On 2014-11-13 14:56:19, ETHER wrote: Show quoted text
> On Thu, Nov 13, 2014 at 05:40:50PM -0500, Olaf Alders via RT wrote:
> > > I'd love to see this fixed, and I'll even be happy to help.
> > > > Bump!
> > *awakens from slumber, finds that someone gave me comaint* :)
Oops, my mistake, I got this email because I'd added myself as a requestor years ago. Lincoln Stein, are you interested in continuing to maintain this distribution, or would you rather hand it off? I found this repository, but it isn't up to date with the last release: https://github.com/rafl/devel-cycle
On Thu Nov 13 19:14:07 2014, ETHER wrote: Show quoted text
> On 2014-11-13 14:56:19, ETHER wrote:
> > On Thu, Nov 13, 2014 at 05:40:50PM -0500, Olaf Alders via RT wrote:
> > > > I'd love to see this fixed, and I'll even be happy to help.
> > > > > > Bump!
> > > > *awakens from slumber, finds that someone gave me comaint* :)
> > Oops, my mistake, I got this email because I'd added myself as a > requestor years ago. > > Lincoln Stein, are you interested in continuing to maintain this > distribution, or would you rather hand it off? > > I found this repository, but it isn't up to date with the last > release: https://github.com/rafl/devel-cycle
There's a new release which notes that the repo is now at https://github.com/lstein/Devel-Cycle
Hey All, I got HTML-Mason as my CPAN Pull Request Challenge this month and this error is still causing warnings during the test run. alex@yuzu:~/Documents/Git/cpan-pull-request-challenge-2015/10-HTML-Mason$ prove -l t/23-leak2.t t/23-leak2.t .. Unhandled type: REGEXP at /home/alex/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/Devel/Cycle.pm line 107. t/23-leak2.t .. ok All tests successful. That's on Devel::Cycle 1.12.
RT-Send-CC: lincoln.stein [...] gmail.com
Hello from 2018! Any chance of getting these patches applied? Thank you!
On 2018-05-02 05:40:20, TONKIN wrote: Show quoted text
> Hello from 2018! Any chance of getting these patches applied? Thank you!
Bump! It looks like all that is needed here is to add a few more lines to the _get_type function for 'REGEXP' and 'GLOB'. Lincoln, how can we help?