in reply to Re: Re: General Class Creation Using Persistent Object, Method Privacy Enforcement and Exceptions
in thread General Class Creation Using Persistent Object, Method Privacy Enforcement and Exceptions

Why write \%{$self}? It's a waste of both space and execution time for your code (perl may optimize it, but it's still a waste of space...) Instead, use $self, which is the exact same thing, and makes it obvious that you're putting a blessed object into the file (it took me a while to comprehend that \%{$self} somehow kept the object blessed and returned $self, itself-- this is completely countra-my previous knowledge of perl. Could somebody explain why that works?)
  • Comment on Re: Re: Re: General Class Creation Using Persistent Object, Method Privacy Enforcement and Exceptions

Replies are listed 'Best First'.
Re^4: General Class Creation Using Persistent Object, Method Privacy Enforcement and Exceptions
by Anonymous Monk on Jun 22, 2005 at 01:14 UTC
    I agree. \%{$self} takes about five minutes to type. $self takes 1.618033989 seconds to type(I timed it.) To use an analogy, 1.618033989 is a lot easier than writing {sqrt(5) + 1}/2. And phi is easier still. As the author of "Walden Pond" asserted concisely, "Simplify, simplify." -100104
Re: Re: Re: Re: General Class Creation Using Persistent Object, Method Privacy Enforcement and Exceptions
by DeadPoet (Scribe) on Jul 02, 2003 at 01:07 UTC
    After evaluating the difference between \%{ $self } and $self, I see that you are correct. I see that I am making perl perform a dereference to the same memory location. I will make corrections in my code. Thanks for the input.

    Peace Out,

    DeadPoet