in reply to difference between OOPs in Perl and java
An object in Perl is really just a reference that has been blessed into a namespace (and that could be a blessed directory handle if you are that perverse).
Together with dynamic features like AUTOLOAD that makes it (in the general case) very hard to introspect objects (i.e. figuring out at runtime which attributes and methods an object has) - something that is easy in Java.
Also classes in Java are "closed" i.e. you cannot add new methods at runtime whereas in Perl a "class" is just a package and methods can be added easily at runtime.
Finally (this is where Java wins hands-down) the memory-management (i.e. garbage-collection) in Perl is based on a simple reference-counting algorithm whereas in Java is is a mark-and-sweep strategy which means that whole graphs of unreachable objects will be garbage-collected in Java whereas in Perl a simple circular reference will leak memory unless you explicitely weaken a reference.
|
|---|