There's more than one way to do things | |
PerlMonks |
Re^2: say variable in Classby Edelbaer (Initiate) |
on Jun 02, 2018 at 18:12 UTC ( [id://1215753]=note: print w/replies, xml ) | Need Help?? |
Hello Ron, thank you for your reply. I think what you mean is that $.x would be accessible in the class as part of a method but not directly. Therefore your first method will work of course but defeats a bit the idea that the object on creation reports its status. The second approach works exactly as it should. And I guess now I need to learn why. So you were absolutely right about the intention :). Now I know what to learn, that is real progress! Thx a lot!
In Section
Seekers of Perl Wisdom
|
|