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