- or download this
use threads;
use threads::shared;
...
$a->get_s();
}->join();
}
- or download this
P:\bin>perl threads_test.cgi
Created A at HASH(0x225800)
...
thread start
Destroy A=HASH(0x1dbba9c)
Destroy A=HASH(0x225800)
- or download this
package A;
our %created_objs : unique;
...
$created_objs{ $self } = 1;
return $self;
}
- or download this
sub DESTROY {
my $self = shift;
...
delete $created_objs{ $self };
}
}