my $obj = 'MyObject'->new( name => 'Typoed', debyg => 1 );
Also, the main point of getters and setters is encapsulation. Directly accessing the attributes breaks it. If you later decide to change the implementation, you need to change the code that touches the attributes as well.
In reply to Re^2: Object Oriented Perl - very basic guide
by choroba
in thread Object Oriented Perl - very basic guide
by Preceptor
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |