class/object variables

2015-04-23 Thread mt1957
L.s. The following piece of code shows that one must be careful using my or state variables in a class. They have the same behavior as an our variable if I am right. Are they all kind of global to the class/object? --- class A { my $a; has $.a; our $p; state $q; method set ($b) {

Re: class/object variables

2015-04-23 Thread Moritz Lenz
On 04/21/2015 10:37 PM, mt1957 wrote: L.s. The following piece of code shows that one must be careful using my or state variables in a class. They have the same behavior as an our variable if I am right. The difference is that 'our'-variables can be accessed from the outside ($A::p), 'my'