Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 examining the Monastery: (2)
As of 2021-03-05 05:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My favorite kind of desktop background is:











    Results (109 votes). Check out past polls.

    Notices?