develooper Front page | perl.perl5.porters | Postings from January 2008

[perl #49366] SEGFAULT with with tie and STDOUT

Thread Next
Steve Peters
January 3, 2008 20:32
[perl #49366] SEGFAULT with with tie and STDOUT
Message ID:
# New Ticket Created by  Steve Peters 
# Please include the string:  [perl #49366]
# in the subject line of all future correspondence about this issue. 
# <URL: >

The code below SEGFAULTS with Perls back to at least 5.8.1-RC3 through
up to date bleadperls.

use strict;

package TestHandle;
require Tie::Handle;

use base qw(Tie::Handle);

sub TIEHANDLE { print "<TestHandle>\n"; my $i; bless \$i, shift }
sub PRINT { print $self "<TestHandle>:  ", shift }

package main;
tie *STDOUT, "TestHandle";
print "Hello";

The actual output is...

Deep recursion on subroutine "TestHandle::PRINT" at line 12.
Segmentation fault (core dumped)

I'm certainly doing something wrong, but a SEGV is probably not the
right feedback to give the users.

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About