Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Re: Re: How can I add the values of a hash?

by OM_Zen (Scribe)
on Feb 08, 2003 at 17:36 UTC ( #233744=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Re: How can I add the values of a hash?
in thread How can I add the values of a hash?

Hi ,

eval { my $values_accrued = join "+",@hash{keys %hash};print + "[$values_accrued]\n"; }


You can do this to accrue the values of the hash and store it to a scalar variable if that is what you need to have for the value of the addendum of the values of the hash itself .(The code is untested ,just try out and say ,I am in a friend's place with no perl in his computer ,(Hey would this work ) shall go home and test it)


Comment on Re: Re: Re: Re: How can I add the values of a hash?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (6)
As of 2014-07-12 19:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (240 votes), past polls