in reply to OO Perl: Methods To Reference Hash
You can't do that. A hash can only have strings for keys, and scalars for values. You can put REFERENCES to hashes in as the values, but then you need to access them accordingly.( ..., hshAgg => %hshAgg ) ... return $self->{hshAgg}; ... $self->{hshAgg} => %hshAgg;
Even yet, returning a whole hash isn't nice; you should return a reference to it, but then your caller has to be modified to expect a reference, too.hshAgg => \%hshAgg ... return %{$self->{hshAgg}}; ... $self->{hshAgg} => \%hshAgg;
--
[ e d @ h a l l e y . c c ]
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: OO Perl: Methods To Reference Hash
by P0w3rK!d (Pilgrim) on Jun 03, 2003 at 21:00 UTC | |
by halley (Prior) on Jun 03, 2003 at 21:03 UTC | |
by P0w3rK!d (Pilgrim) on Jun 03, 2003 at 21:34 UTC | |
Re: Re: OO Perl: Methods To Reference Hash
by P0w3rK!d (Pilgrim) on Jun 03, 2003 at 20:42 UTC |
In Section
Seekers of Perl Wisdom