tima has asked for the wisdom of the Perl Monks concerning the following question:
I'm trying to use Filter::Handle in a script I'm writing (it does exact what I want I need) and see that its tests have been segfaulting on Perl 5.8+. Perl 5.6 seems uneffected. The problem lies in this test for the Filter and UnFilter methods:
my $out; Filter \*STDOUT, sub { $out = sprintf "%d: %s\n", 1, "@_"; () }; print "Foo"; UnFilter \*STDOUT; print $out eq "1: Foo\n" ? "ok 3\n" : "not ok 3\n";
Here is the code to those two methods:
sub Filter { my $fh = $_[0]; tie *{ $fh }, __PACKAGE__, @_; } sub UnFilter { my $fh = shift; { local $^W = 0; untie *{ $fh } } }
Perl's internals are not my forte so I don't see or understand what is going wrong. I was hoping someone here could clue me in. The maintainer of the module has his hands full with a few other things right now.
Thanks.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Filter::Handle segfault in Perl 5.8+
by tima (Acolyte) on Oct 26, 2007 at 22:42 UTC | |
by tima (Acolyte) on Oct 27, 2007 at 01:33 UTC |