in reply to Re: Sub routine processing issue, HELP!!!!!
in thread Sub routine processing issue, HELP!!!!!

Why don't you just take advantage of auto-vivification to generate hash keys and returning the value from your subroutine?

Something like:

sub total { my ($N_NUM) = @_; # expression is obviously pseudo-code if ($N_NUM is in database) { return 'FOUND'; } return 'NOT FOUND'; } my %dblist; $dblist{"$N_NUM"} = total($N_NUM); foreach my $item (sort keys %dblist) { # print table row print $item; print $dblist{"$item"}; }
(edit: didn't really understand the question the first time, and am still not sure if I understand it.)