package MeSH::KOL; use strict; use vars qw($VERSION); $VERSION = '0.01'; sub new { my ($class) = @_; my $self = {}; $self->{KOLS} = (); bless $self, $class; return $self; } # end-sub sub build_KOL { my($self) = @_; # for this example my %results = (); $results{1} = "blah1"; $results{2} = "blah2"; $self->{KOLS} = %results; } # end-sub sub get_all_KOLS { my ($self) = @_; return $self->{KOLS}; #my %hash = (); #$hash{1} = "blah1"; #$hash{2} = "blah2"; #return %hash; } # end-sub #### #/usr/bin/perl use MeSH::KOL; my $kol_q = new MeSH::KOL; $kol_q->build_KOL; my (%kols) = $kol_q->get_all_KOLS; foreach my $auth_id (keys %kols) { print "$auth_id = $kols{$auth_id}\n"; } # end-foreach