Jayakumar Rajagopal wrote:
> Hi ,
> I have to store list of objects in Array. At the end, @arr contains n
> copies of last $obj, but not every $obj created. I tried storing both
> object, ref of object. Array contains different references, but same
> data. Please help.  
> thanks,
> Jay
> 
> the current code looks like this :
> 
> $n=0;
> my @arr=();
> while ( @results )
> {
> $n++;
> my $obj = RowClass->new();
> ...
> ...
> 
> push @arr, $obj;
> }

each call to RowClass::new should be returning a unique bless()'d reference.
If that's the case, the rest of your code looks fine. What is
RowClass::new() doing?

-- 
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