Re: Constructors (was: RE: deleting a hash ref's contents)

2004-02-25 Thread R. Joseph Newton
"Charles K. Clarkson" wrote: > Hello all, > > The following thread was part of a reply written a while back. Whoops. Missed it on my earlier post. > This constructor: > sub new { > my $class = shift; > my $self = { > file_name => undef, > base=> undef, >

Re: Constructors (was: RE: deleting a hash ref's contents)

2004-02-25 Thread R. Joseph Newton
"Charles K. Clarkson" wrote: > Hello all, > > The following thread was part of a reply written a while back. > > R. Joseph Newton <[EMAIL PROTECTED]> wrote: > : > : Gary Stainburn wrote: > : > : > sub new { > : > my $this=shift;# allow for CLASS->new() > : > my $class=ref($

Re: Constructors (was: RE: deleting a hash ref's contents)

2004-02-25 Thread James Edward Gray II
On Feb 25, 2004, at 12:05 AM, Charles K. Clarkson wrote: Hello all, The following thread was part of a reply written a while back. R. Joseph Newton <[EMAIL PROTECTED]> wrote: : : Gary Stainburn wrote: : : > sub new { : > my $this=shift;# allow for CLASS->new() : > my $cla

RE: Constructors (was: RE: deleting a hash ref's contents)

2004-02-25 Thread David le Blanc
> -Original Message- > From: Charles K. Clarkson [mailto:[EMAIL PROTECTED] > Sent: Wednesday, 25 February 2004 5:05 PM > To: [EMAIL PROTECTED] > Subject: Constructors (was: RE: deleting a hash ref's contents) > > Hello all, > > The following thre

Constructors (was: RE: deleting a hash ref's contents)

2004-02-24 Thread Charles K. Clarkson
Hello all, The following thread was part of a reply written a while back. R. Joseph Newton <[EMAIL PROTECTED]> wrote: : : Gary Stainburn wrote: : : > sub new { : > my $this=shift;# allow for CLASS->new() : > my $class=ref($this) || $this; # or $obj->new(); : : The docs

Re: deleting a hash ref's contents

2004-01-05 Thread Randal L. Schwartz
> "Gary" == Gary Stainburn <[EMAIL PROTECTED]> writes: Gary> Now when I wish to DESTROY the hash, I need to free the memory Gary> used by the hash, including the two arrays _Links and _Signals. Gary> Am I right in thinking that the arrays, along with the scalars Gary> will be deleted by the g

Re: deleting a hash ref's contents

2004-01-05 Thread R. Joseph Newton
James Edward Gray II wrote: > Since we didn't see anything outside of the constructor in the posted > code, I assumed (possibly incorrectly) that $blocks was some form of > class data. I see no problem with setting some class data from the > constructor, if needed. Good point. I'm afraid I enti

Re: deleting a hash ref's contents

2004-01-05 Thread James Edward Gray II
On Jan 5, 2004, at 10:11 AM, Rob Dixon wrote: James Edward Gray II wrote: On Jan 5, 2004, at 9:24 AM, R. Joseph Newton wrote: Gary Stainburn wrote: sub new { my $this=shift;# allow for CLASS->new() my $class=ref($this) || $this; # or $obj->new(); The docs that suggested this

Re: deleting a hash ref's contents

2004-01-05 Thread Steve Grazzini
On Jan 5, 2004, at 10:44 AM, James Edward Gray II wrote: DESTROY() is the traditionally accepted place to do something like break a circular reference Bzzzt! :-) DESTROY can't be called *until* the circular reference is broken (or the script exits and everything gets destroyed, regardless of refc

Re: deleting a hash ref's contents

2004-01-05 Thread Rob Dixon
James Edward Gray II wrote: > > On Jan 5, 2004, at 9:24 AM, R. Joseph Newton wrote: > > > Gary Stainburn wrote: > > > >> sub new { > >> my $this=shift;# allow for CLASS->new() > >> my $class=ref($this) || $this; # or $obj->new(); > > > > The docs that suggested this are in the p

Re: deleting a hash ref's contents

2004-01-05 Thread James Edward Gray II
On Jan 5, 2004, at 9:24 AM, R. Joseph Newton wrote: Gary Stainburn wrote: sub new { my $this=shift;# allow for CLASS->new() my $class=ref($this) || $this; # or $obj->new(); The docs that suggested this are in the process of being deprecated. It is not a good idea to have obj

Re: deleting a hash ref's contents

2004-01-05 Thread R. Joseph Newton
Gary Stainburn wrote: > Hi folks, > > I'm working for the first time with object, my $self being a ref to an > anonymous hash, i.e. Couple not so good things here. > > > sub new { > my $this=shift;# allow for CLASS->new() > my $class=ref($this) || $this; # or $obj->new(); Th

Re: deleting a hash ref's contents

2004-01-05 Thread Rob Dixon
Gary Stainburn wrote: > > > Gary Stainburn wrote: > > > I'm working for the first time with object, my $self being a ref to an > > > anonymous hash, i.e. > [snip] > > > Now when I wish to DESTROY the hash, I need to free the memory used by > > > the hash, including the two arrays _Links and _Signal

Re: deleting a hash ref's contents

2004-01-05 Thread Gary Stainburn
On Monday 05 January 2004 1:37 pm, Rob Dixon wrote: > Gary Stainburn wrote: > > I'm working for the first time with object, my $self being a ref to an > > anonymous hash, i.e. [snip] > > Now when I wish to DESTROY the hash, I need to free the memory used by > > the hash, including the two arrays _L

Re: deleting a hash ref's contents

2004-01-05 Thread Rob Dixon
Gary Stainburn wrote: > > 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=

Re: deleting a hash ref's contents

2004-01-05 Thread Dan Anderson
IIRC, Perl's garbage collection system sits in the background waiting until it finds a chunk of memory not referenced by any variable and then deletes it. So references to anything keep the memory connected to the reference in play until either Perl dies or there are no variables which con