Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re^2: Sub routine processing issue, HELP!!!!!

by dazzle (Sexton)
on Dec 08, 2004 at 22:52 UTC ( #413365=note: print w/replies, xml ) Need Help??


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.)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://413365]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others about the Monastery: (5)
As of 2019-11-15 03:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Strict and warnings: which comes first?



    Results (80 votes). Check out past polls.

    Notices?