D
Dale Wiles
I think I found a bug in perl's "warnings" pragma, but I want to
make sure that it's an actual, reproducible bug before reporting it.
This program, posted below, should die at "Killed me.". If I run
it I get:
Saw me. at perl_warnings_fails line 36
Killed me. at perl_warnings_fails line 40
Revenge from beyond the grave! at perl_warnings_fails line 43
Out of the function. at perl_warnings_fails line 48
If I uncomment "my $y = \@_;"
Saw me. at perl_warnings_fails line 36
Killed me. at perl_warnings_fails line 40
which is what's expected.
There's nothing special about "my $y = \@_;". Pretty much anything
that touches "@_" masks the bug. "@_ = ();" works as does "print \@;"
That's why I think it's a bug in the Perl interpreter.
I'm using perl, v5.8.7 built for i486-linux. If someone has 5.8.8 I'd
especially appreciate hearing from them.
Dale (Don't really IgnoreMe) Wiles
---- perl_warnings ----
#!/usr/bin/perl
package Foo;
use strict;
use warnings::register;
sub new($)
{
my ($self) = @_;
my $class = { };
bless $class, $self;
return $class;
}
sub warnme($$)
{
my ($self, $text) = @_;
warnings::warnif($self, $text);
}
1;
package main;
use strict;
use warnings;
sub wtest($)
{
my $f = shift;
# my $y = \@_;
$f->warnme('Saw me.');
{
use warnings FATAL => 'Foo';
$f->warnme('Killed me.');
}
$f->warnme('Revenge from beyond the grave!');
}
my $g = Foo->new;
wtest($g);
$g->warnme('Out of the function.');
make sure that it's an actual, reproducible bug before reporting it.
This program, posted below, should die at "Killed me.". If I run
it I get:
Saw me. at perl_warnings_fails line 36
Killed me. at perl_warnings_fails line 40
Revenge from beyond the grave! at perl_warnings_fails line 43
Out of the function. at perl_warnings_fails line 48
If I uncomment "my $y = \@_;"
Saw me. at perl_warnings_fails line 36
Killed me. at perl_warnings_fails line 40
which is what's expected.
There's nothing special about "my $y = \@_;". Pretty much anything
that touches "@_" masks the bug. "@_ = ();" works as does "print \@;"
That's why I think it's a bug in the Perl interpreter.
I'm using perl, v5.8.7 built for i486-linux. If someone has 5.8.8 I'd
especially appreciate hearing from them.
Dale (Don't really IgnoreMe) Wiles
---- perl_warnings ----
#!/usr/bin/perl
package Foo;
use strict;
use warnings::register;
sub new($)
{
my ($self) = @_;
my $class = { };
bless $class, $self;
return $class;
}
sub warnme($$)
{
my ($self, $text) = @_;
warnings::warnif($self, $text);
}
1;
package main;
use strict;
use warnings;
sub wtest($)
{
my $f = shift;
# my $y = \@_;
$f->warnme('Saw me.');
{
use warnings FATAL => 'Foo';
$f->warnme('Killed me.');
}
$f->warnme('Revenge from beyond the grave!');
}
my $g = Foo->new;
wtest($g);
$g->warnme('Out of the function.');