
FishMonger
Veteran
Jul 28, 2011, 8:07 AM
Views: 2256
|
|
Re: [jc1742] Accessing package variables?
|
|
|
Your new sub needs to declare and assign default values to the vars (which is typically done via a hash ref) and then return the blessed hash ref. The new sub could also accept args, i.e., a hash ref, containing the desired values to be put into the object. Then you need to write accessor/mutator subs which retrieve and/or set the vars. See the following perldocs. perlboot Perl OO tutorial for beginners perltoot Perl OO tutorial, part 1 perltooc Perl OO tutorial, part 2 perlbot Perl OO tricks and examples
(This post was edited by FishMonger on Jul 28, 2011, 8:09 AM)
|