Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Why get() and set() accessor methods are evil

by synistar (Pilgrim)
on Nov 25, 2003 at 16:46 UTC ( #309952=perlmeditation: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    package OOtest;
    sub new {
    ...
        my $self = shift;
        return $self->{list};
    }
    
  2. or download this
    my $obj = OOtest->new();
    foreach my $tmp ( @{ $obj->get_list() } ) {
        # process list
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://309952]
Approved by broquaint
Front-paged by bart
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (2)
As of 2021-01-23 09:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?