[kw-pm] Problem with hash

Robert Pike roberthpike at yahoo.com
Wed Jul 29 11:14:37 PDT 2009


First off, thanks to all that supplied me with feedback in regards to the issue I was having with redirection in perl. 
I loop through an array, split the values, and put certain values in a hash. Hopefully this will be enough info to get some feedback.

my %vHash;
$vHsh{"101010"}{"S0"} = "text";
$vHsh{"101010USED"}{"S0"} = "text";

my @aA = ("101010~S0", "101010USED~S0");
#if I were to do this 
for (my $cC=0$cC<=$#aA;$cC++) {
    ($itm1, $itm2) = split(/\~/,$aA[$cC]);    
    if (!exists($vHsh{$itm1}{"S".$itm2}{"SYSTEM"})) { #--- also tried defined
        $vHsh{$itm1}{"S".$itm2}{"SYSTEM"} = "TEXT";
    }
}

    The if statement (with the defined/exists check) criteria passes first pass but fails in the second. Can anyone tell me why?


      __________________________________________________________________
Connect with friends from any web browser - no download required. Try the new Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php



More information about the kw-pm mailing list