Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Trying to understand Perl Objects

by sundialsvc4 (Abbot)
on Apr 07, 2009 at 12:28 UTC ( [id://756008]=note: print w/replies, xml ) Need Help??


in reply to Trying to understand Perl Objects

The key thing to recognize about “Perl objects” is that they are “other” data-structures ... usually hashes ... but they have had an epiphany. They are data structures that have been blessed, which is simply an attribute that Perl can recognize.

When a data-structure has been “blessed,” Perl knows how to associate it with a particular package. Method calls therefore succeed, and they are resolved by looking up the package (and thence following the @ISA list).

That's it.

As for “the speed issue,” I am frankly of the opinion that:   at 500 million operations per second (or considerably more...) no one can hear you scream. The speed and reliability with which you can write the code, and with which it subsequently runs, trumps other petty-concerns in nearly evey practical case. If your application cannot tolerate the overhead of method-lookups, etc., then you should use another language for at least this part of it. However, you should refrain from judgment on this matter until you have actual benchmarks. You may be pleasantly surprised.

Replies are listed 'Best First'.
Re^2: Trying to understand Perl Objects
by Zen (Deacon) on Apr 07, 2009 at 18:30 UTC
    The funny part to the speed thing is that a lot of these same alarmed folks will then go to java, which IMO truly shows the expense of going all-out on object oriented programming. OO for everything is not appropriate, and whomever started that rumor should be president of marketing somewhere.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-19 11:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found