Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Re: Re: General Class Creation Using Persistent Object, Method Privacy Enforcement and Exceptions

by Anonymous Monk
on Jul 01, 2003 at 18:54 UTC ( [id://270602]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://270602]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2024-04-24 23:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found