and the output is like this;#!/usr/bin/perl -w #name: monk_perlobj # note: copied from perlobj # purpose: to understand DESTORY block for object package Subtle; sub new { my $test; $test = \$test; warn "CREATING ". \$test; return bless \$test; } sub DESTORY { my $self = shift; warn "DESTORYING $self"; } package main; warn "starting program"; { my $a = Subtle->new; my $b = Subtle->new; $$a = 0; #break selfref warn "leaving block"; } warn "just exited block"; warn "time to die ..."; exit;
but the corresponding output from perlobj actually has two other lines from the destructor block. Could someone tell me why I am not able to see them? Is it related how perl was bulit and how can I check it. thanks very much indeed.starting program at ./monk_perlobj line 23. CREATING REF(0x816b8e8) at ./monk_perlobj line 12. CREATING REF(0x81523ec) at ./monk_perlobj line 12. leaving block at ./monk_perlobj line 28. just exited block at ./monk_perlobj line 31. time to die ... at ./monk_perlobj line 32
In reply to about destructor by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |