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();
    # NOT foreach my $tmp ( @{ $obj->list() } 
    foreach my $tmp ( @{ $obj->get_array() } ) {
       # process list
    }
    
  3. or download this
    package OOtest;
    sub new {
    ...
       my $self = shift;
       return values %{$self->{list}}; # anything asking for an array gets
    + it
    }