Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot

Re^2: Is Perl Truly an Object Oriented Language?

by BrentDax (Hermit)
on Feb 05, 2005 at 23:21 UTC ( [id://428399]=note: print w/replies, xml ) Need Help??

in reply to Re: Is Perl Truly an Object Oriented Language?
in thread Is Perl Truly an Object Oriented Language?

If that bothers you, just treat the object as a handle used to get at your real implementation:

package My::Class; our @ISA=qw(Base::Class); my %obj; sub new { ... my $h=$class->SUPER::new; $obj{$h}{host}=shift; $obj{$h}{port}=shift; ... } sub DESTROY { my $h=shift; delete $obj{$h}; $h->SUPER::DESTROY; }

Now Base::Class could change to using a tied filehandle as its implementation, for all you care.

The reality is that most classes you would want to subclass are designed to make it safe, and even if they aren't there are a few simple measures you can take (like prefixing your subclass's keys with your module's name). And Perl is more than flexible enough for you to do things completely safely if you're really worried.

--Brent Dax
There is no sig.

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (1)
As of 2024-05-23 20:14 GMT
Find Nodes?
    Voting Booth?

    No recent polls found