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