Skip Menu |

This queue is for tickets about the Method-Signatures CPAN distribution.

Report information
The Basics
Id: 65598
Status: resolved
Priority: 0/
Queue: Method-Signatures

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

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



Subject: Weird problem on 5.8.7
Hi Schwern, This is kind of hard to describe, so here is some code. This: #!/usr/local/bin/perl use strict; use warnings; use Method::Signatures; func foo ($params) { return 1; } func bar ($params) { return 1; } func baz ($params) { return 1; } sub main { exit 0 if ( foo('stuff') && bar('stuff') && baz('stuff') ); exit 1; } main(); deparses ( using perl -MO=Deparse fails.pl) to: sub Digest::base::clone; sub Digest::base::new; sub Digest::base::add; sub Digest::base::digest; use Method::Signatures; sub BEGIN { BEGIN {${^WARNING_BITS} = "UUUUUUUUUUUU"} use strict 'refs'; 'Method::Signatures'->inject_scope(''); } BEGIN {${^WARNING_BITS} = "UUUUUUUUUUUU"} use strict 'refs'; sub BEGIN { 'Method::Signatures'->inject_scope(''); } ; sub BEGIN { 'Method::Signatures'->inject_scope(''); } ; sub main { exit 0 if foo(1) and and ; exit 1; } main ; See that part in sub main? The part with the "and and ". That's weird. Additionally, the code doesn't do what it should. It exits with 1 instead of with 0. Why does that happen? I know it's Perl 5.8.7 which is old, but still, it Method::Signatures installed so I figured it would be okay. Let me know if this shouldn't be in the Method::Signatures queue. Thanks, Darian
Subject: fails.pl
#!/usr/local/bin/perl use strict; use warnings; use Method::Signatures; func foo ($params) { return 1; } func bar ($params) { return 1; } func baz ($params) { return 1; } sub main { exit 0 if ( foo('stuff') && bar('stuff') && baz('stuff') ); exit 1; } main();
Subject: Re: [rt.cpan.org #65598] Weird problem on 5.8.7
Date: Thu, 10 Feb 2011 22:18:03 +1300
To: bug-Method-Signatures [...] rt.cpan.org
From: Michael G Schwern <schwern [...] pobox.com>
Possibly there's some weird interaction with the optimizer. Does this happen without Method::Signatures? ie. use strict; use warnings; sub foo { my($params) = @_; return 1; } sub bar { my($params) = @_; return 1; } sub baz { my($params) = @_; return 1; } sub main { exit 0 if ( foo('stuff') && bar('stuff') && baz('stuff') ); exit 1; } main(); -- 31. Not allowed to let sock puppets take responsibility for any of my actions. -- The 213 Things Skippy Is No Longer Allowed To Do In The U.S. Army http://skippyslist.com/list/
Darian, I'm assuming this is no longer a problem, as it's been two years since your original report. If you're still seeing this issue in the latest version of Method::Signatures, please feel free to reopen the ticket. Thanx.