in reply to Re: Lady_TM
in thread Lady_TM
I am in the habit od using the line:
my $self = shift;
in each method that is to be accessed externally. Keeping a method private is sometimes desireable, those methods do not include the line. I took this from the good book "Perl from the Ground UP."
In experience, if I forget to insert this line, the method IS unavailable. I do it now out of habit.
Looking in the Perl Cookbook I see that this first shift is used to associate the method as a member of the "class object."
This is not something that has anything to do with the method's prototype. The prototype will never take into account that the class association is the first shifted item in object-oriented Perl class method.
Its something I don't understand fully, but I do it.
-Steeeeeve
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re (tilly) 3: Lady_TM
by tilly (Archbishop) on Feb 04, 2001 at 11:58 UTC | |
by Steeeeeve (Initiate) on Feb 05, 2001 at 09:40 UTC | |
|