Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

OO - best way to have protected methods

by gargle (Chaplain)
on Aug 17, 2005 at 13:54 UTC ( [id://484432]=perlquestion: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    # private method add
    my $add = sub {
    ...
            my $amount = shift;
            $self->balance($self->balance+$amount);
    };
    
  2. or download this
    # private method padd
    sub padd {
    ...
            print caller(0) . " " . __PACKAGE__;
            $self->balance($self->balance+$amount);
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://484432]
Approved by Corion
Front-paged by kwaping
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: (6)
As of 2024-04-19 07:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found