No such thing as a small change | |
PerlMonks |
Re: Re: Lady_TMby Steeeeeve (Initiate) |
on Feb 02, 2001 at 03:48 UTC ( [id://55908]=note: print w/replies, xml ) | Need Help?? |
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
In Section
Code Catacombs
|
|