in reply to OO Perl: after it creates 2nd object overwrites hash from the first
Change
%{$self->{_hash}} = ();
to
$self->{_hash} = {};
Output:
this is cat data cat:a,b,c,d,e,fcat2:g,h,i,j,k,l,m this is cat keys catcat2 this is dog data dog1:1,2,3,4,5,6,7dog2:21,22,23,24,25 this is dog keys dog1dog2 but....after creates the second object this is cat data cat:a,b,c,d,e,fcat2:g,h,i,j,k,l,m this should be cat keys catcat2 this is dog data dog1:1,2,3,4,5,6,7dog2:21,22,23,24,25 this is dog keys dog1dog2
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: OO Perl: after it creates 2nd object overwrites hash from the first
by flope004 (Acolyte) on Aug 31, 2007 at 18:04 UTC | |
by FunkyMonk (Bishop) on Aug 31, 2007 at 18:14 UTC |