Your first is wrong (it's setting the value for the key "string1" in your instance), the second is actually setting $string2, and the third is similarly wrong (again mucking with the instance).
You might want to look at Class::MethodMaker which will write accessors for you.
In reply to Re: correct usage of class attributes
by Fletch
in thread correct usage of class attributes
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |