in reply to Re: Object Oriented Perl - very basic guide
in thread Object Oriented Perl - very basic guide
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Object Oriented Perl - very basic guide
by Preceptor (Deacon) on Jun 30, 2014 at 13:51 UTC |