today's segv

OK. I know the code is sucks. But, interpreters should not dump core :P

use strict;
use warnings;
use Test::More;
use IO::Socket::SSL;

{

    package TestApp;
    use strict;
    use parent qw(IO::Socket::INET);
    use Test::More;

    sub new {
        my $class = shift;
        my $type = ref($class) || $class;

        my $self = $type->SUPER::new(
            PeerAddr => 'mixi.jp',
            PeerPort => 443,
            Proto => 'tcp',
            Timeout => 3
        );
        $self;
    }

    sub DESTROY {
        my $me = shift;
        diag @TestApp::ISA;
        diag fileno($me);
    }
}

{
    local @TestApp::ISA = qw/IO::Socket::SSL/;

    my $pop = TestApp->new( )
      or die "Can't connect";
}

ok 1, "reach here";
done_testing;

Published: 2010-06-10(Thu) 16:44