On Jan 25, 2004, at 7:47 AM, Pedro Miguel Freire Custódio wrote: [..]

sub _init {
my $self = shift;
$self->{OBJECT} = ("xpto1","xpto2"); ---> THE PROBLEM! It only stores xpto2
if (@_) {
my %extra = @_;
@$self{keys %extra} = values %extra;
}
}


And when i try to use this method:

sub object {
        my $self = shift;
        return $self->{OBJECT} unless @_;
        
        my @list = $self->{OBJECT};
[..]

have we thought about doing that as an array ref?

        $self->{OBJECT} = ["xpto1","xpto2"];
...
        my @list = @{$self->{OBJECT}};


ciao drieux

---


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to