develooper Front page | perl.beginners | Postings from January 2012

Collecting variables from Hash

Thread Next
From:
Pradeep Patra
Date:
January 22, 2012 08:37
Subject:
Collecting variables from Hash
Message ID:
bffd59b6-c856-4a47-895e-79f12526096a@z12g2000yqm.googlegroups.com
Hi,
   I have a hash reference as follows:

$VAR1 = {
    A.processor0.error       => 0
    A.processor0.success     => 77
    A.processor0.total        => 77
    A.processor1.error        => 0
    A.processor1.success      => 57
    A.processor1.total        => 57
    A.processor2.error        => 0
    A.processor2.success      => 110
    A.processor2.total        => 110



}


I want to collect the values from the different processors(for exp:
success value of processor0,processor1,processor2 and sum them i.e 77
+ 57 +110 = 244 ).and store in a variable $success.

If ($success == 244)
{
    return 1;



} else {
     return 0;
}


Can anybody help me in this regard?

Regards
Pradeep



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About