in reply to Packages, references, & data hiding...
$buddys = %data;
This is not what you want at all.
What you actually want is a scalar which is a reference to %data to be stored in $buddys which you can then dereference in your loop.
This means you want the equivelent of this:
$buddys = \%data;
In _init_Authentication you are already doing half of this ie:
$self->{'buddy_list'} = \%buddylist;
And then in BuddyList, $self->{'buddy_list'} still contains a reference to the hash you want as it does when you try using directly in main.
So all you need to return is $self->{'buddy_list'} which then gets put in $buddys and can be used as you wish.
Hope that was what you wanted to know.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Packages, references, & data hiding...
by zzspectrez (Hermit) on Dec 04, 2000 at 01:11 UTC | |
by SamQi (Beadle) on Dec 04, 2000 at 01:52 UTC | |
by arturo (Vicar) on Dec 04, 2000 at 06:04 UTC | |
by repson (Chaplain) on Dec 04, 2000 at 06:52 UTC |