I have two hashes and each is made up of two keys. One has only
a numeric value and the the second one has the detail. If I find out
that I have right situation, I change the numeric value in the first
hash. I have done data dumper where I create the hash and as I update
the hash value and everything looks like I would expect it. 
 
        So I decided to delete the keys from hash 1 and 2 if the numeric
value on hash 1 is not what I want. I print this out with Data::Dumper
and I have hash setup I am not understanding.

Here is a portion of Data::Dumper:
  'VNM' => {
    'LVR' => 9,
    'NVN' => 9
  },
  'BKF' => {
    'FTV' => 9,
    'SVX' => 1,
    'SYO' => 9,
    'BMT' => 9
  },

        but after I get done,it would look like this:

  'VNM' => {},
  'BKF' => {
    'SVX' => 1,
  },

        Here is the code which is doing the delete. I am getting the
right output I need to work with, but I don't understand the {} entries:

            foreach $MyPrtKeya ( keys %{$MyVPEPRelationships} ) {
                foreach $MyPrtKeyb ( keys
%{$MyVPEPRelationships->{$MyPrtKeya}} ) {
                    next if (
$MyVPEPRelationships->{$MyPrtKeya}{$MyPrtKeyb} == 1 );
                    
                    delete($MyVPEPMTs->{$MyPrtKeya}{$MyPrtKeyb});
 
delete($MyVPEPRelationships->{$MyPrtKeya}{$MyPrtKeyb});
                }
             }          

        The code is run under strict and warnings and I get no warnings
etc.

          If you have any problems or questions, please let me know.

     Thanks.

  Wags ;)
David R Wagner
Senior Programmer Analyst
FedEx Freight
1.408.323.4225x2224 TEL
1.408.323.4449           FAX
http://fedex.com/us 


**********************************************************************
This message contains information that is confidential and proprietary to FedEx 
Freight or its affiliates.  It is intended only for the recipient named and for 
the express  purpose(s) described therein.  Any other use is prohibited.
**********************************************************************

  • Deleting hash keys, bu... Wagner, David --- Senior Programmer Analyst --- WGO

Reply via email to