Unrelated to your question, but worth mentioning, is that it is a good idea to use explicit returns. A subroutine will implicitly return the value of the last expression evaluated, however this behavior can be unclear to maintenance programmers.
sub getValue { my $self = shift; return $self->{theValue}; }
You may wish to read Damian Conway's Perl Best Practices. It has a large amount of this sort of advice to offer, as well as discussion of the reasoning behind the recommendations. Some of the book's recommendations are controversial, others are widely accepted. A little searching at the monastery should provide a number of good links discussing PBP.
TGI says moo
In reply to Re: Perl class - how to create instance variable instead of class variable
by TGI
in thread Perl class - how to create instance variable instead of class variable
by richb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |