Hi folks,
I'm working for the first time with object, my $self being a ref to an
anonymous hash, i.e.
sub new {
my $this=shift; # allow for CLASS->new()
my $class=ref($this) || $this; # or $obj->new();
my ($name,$type)[EMAIL PROTECTED];
my $self={};
bless $self,$class;
$self->{_Name}=$_[0]; # name of track block section
$self->{_Type}=$_[1]; # type of block
$self->{_Links}=(); # blocks connected to me
$self->{_Signals}=();
$blocks{$name}=$self;
return $self;
}
Now when I wish to DESTROY the hash, I need to free the memory used by the
hash, including the two arrays _Links and _Signals.
Am I right in thinking that the arrays, along with the scalars will be deleted
by the garbage collector when the references in the hash are deleted?
Am I also right in thinking that this will happen if I lose the reference in
$self by simply running:
$self=undef;
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>