Syntactic Confectionery Delight | |
PerlMonks |
Re^4: Unclear about 'our'by ibm1620 (Hermit) |
on Dec 27, 2022 at 22:44 UTC ( [id://11149152]=note: print w/replies, xml ) | Need Help?? |
I believe I've got it. In your package foo above, my inclination would be to declare 'my $bar;' at the top, before the first sub, and simply refer to it as '$bar', if there were no need for users in other packages to access it. In retrospect, I think using getters and setters is probably better than exposing variables. Thanks for your efforts to clear this up for me.
In Section
Seekers of Perl Wisdom
|
|