Bob, Thanks. Already I have been working out on the same row. I think I misunderstood significance of self reference, which is first parameter of methods. After finishing I would mail. regards, Jay
-----Original Message----- From: Bob Showalter [mailto:[EMAIL PROTECTED] Sent: Thursday, March 04, 2004 1:38 PM To: Jayakumar Rajagopal; [EMAIL PROTECTED] Subject: RE: Array of objects 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>