title: How do I take data from a deeply nested structure based on a value inside of what I want?
body: <p>I have this datastructure:</p>
  
  <pre><code>$VAR1 = {
            'cdr' =&gt; [
                     {
                       'networkInfo' =&gt; {
                                        'extPayer' =&gt; '50351851444',
                                        'eventSource' =&gt; 'J@nus',
                                        'sequenceNumber' =&gt; '0',
                                        'connectionId' =&gt; '0050351851444',
                                        'payer' =&gt; '50351851444',
                                        'status' =&gt; '1',
                                        'mvnoId' =&gt; '2',
                                        'currentStatus' =&gt; '2',
                                        'eventReferenceNumber' =&gt; '1510141545000003101',
                                        'sessionId' =&gt; '1510143920000000011',
                                        'errorCode' =&gt; '0',
                                        'previousStatus' =&gt; '1',
                                        'eventDateTime' =&gt; '20151014154533',
                                        'requestType' =&gt; '51',
                                        'actionDateTime' =&gt; '20151014154533',
                                        'exponent' =&gt; '-6'
                                      },
                       'payerInfo' =&gt; {
                                      'newPayerStatus' =&gt; '2',
                                      'noOfPayerValidity' =&gt; '0',
                                      'prevPayerStatus' =&gt; '1',
                                      'noOfWalletsUsed' =&gt; '0',
                                      'baseWalletBalance' =&gt; '0'
                                    },
                       'pricedInfo' =&gt; {
                                       'totalUsedUnits' =&gt; '0',
                                       'taxingOptionUsed' =&gt; '0',
                                       'totalSalePrice' =&gt; '0',
                                       'totalTax' =&gt; '0',
                                       'totalCostPrice' =&gt; '0',
                                       'chargeSummary' =&gt; {
                                                          'dimensionSummary' =&gt; {
                                                                                'dimensionId' =&gt; '0',
                                                                                'componentSummary' =&gt; {
                                                                                                      'totalSalePrice' =&gt; '0',
                                                                                                      'totalCostPrice' =&gt; '0',
                                                                                                      'componentId' =&gt; '0',
                                                                                                      'totalDiscountAmount' =&gt; '0',
                                                                                                      'bucketsUsed' =&gt; '0'
                                                                                                    }
                                                                              }
                                                        },
                                       'totalDiscountAmount' =&gt; '0',
                                       'bucketsUsed' =&gt; '0'
                                     }
                     },
                     {
                       'networkInfo' =&gt; {
                                        'extPayer' =&gt; '50351851444',
                                        'eventSource' =&gt; 'J@nus',
                                        'sequenceNumber' =&gt; '0',
                                        'connectionId' =&gt; '0050351851444',
                                        'payer' =&gt; '50351851444',
                                        'status' =&gt; '1',
                                        'mvnoId' =&gt; '2',
                                        'currentStatus' =&gt; '2',
                                        'eventReferenceNumber' =&gt; '1510141545000003101',
                                        'sessionId' =&gt; '1510143920000000021',
                                        'errorCode' =&gt; '0',
                                        'previousStatus' =&gt; '2',
                                        'eventDateTime' =&gt; '20151014154535',
                                        'requestType' =&gt; '53',
                                        'actionDateTime' =&gt; '20151014154535',
                                        'exponent' =&gt; '-6'
                                      },
                       'payerInfo' =&gt; {
                                      'newPayerStatus' =&gt; '2',
                                      'noOfPayerValidity' =&gt; '0',
                                      'prevPayerStatus' =&gt; '2',
                                      'noOfWalletsUsed' =&gt; '0',
                                      'baseWalletBalance' =&gt; '0'
                                    },
                       'pricedInfo' =&gt; {
                                       'totalUsedUnits' =&gt; '0',
                                       'taxingOptionUsed' =&gt; '0',
                                       'totalSalePrice' =&gt; '0',
                                       'totalTax' =&gt; '0',
                                       'totalCostPrice' =&gt; '0',
                                       'chargeSummary' =&gt; {
                                                          'dimensionSummary' =&gt; {
                                                                                'dimensionId' =&gt; '0',
                                                                                'componentSummary' =&gt; {
                                                                                                      'totalSalePrice' =&gt; '0',
                                                                                                      'totalCostPrice' =&gt; '0',
                                                                                                      'componentId' =&gt; '0',
                                                                                                      'totalDiscountAmount' =&gt; '0',
                                                                                                      'bucketsUsed' =&gt; '0'
                                                                                                    }
                                                                              }
                                                        },
                                       'totalDiscountAmount' =&gt; '0',
                                       'bucketsUsed' =&gt; '0'
                                     }
                     },
                     {
                       'networkInfo' =&gt; {
                                        'extPayer' =&gt; '50351851444',
                                        'eventSource' =&gt; 'J@nus',
                                        'sequenceNumber' =&gt; '0',
                                        'connectionId' =&gt; '0',
                                        'payer' =&gt; '50351851444',
                                        'status' =&gt; '1',
                                        'mvnoId' =&gt; '2',
                                        'currentStatus' =&gt; '2',
                                        'eventReferenceNumber' =&gt; '0',
                                        'sessionId' =&gt; '2015101400000335940',
                                        'errorCode' =&gt; '0',
                                        'previousStatus' =&gt; '2',
                                        'eventDateTime' =&gt; '20151014154540',
                                        'requestType' =&gt; '3',
                                        'actionDateTime' =&gt; '20151014154535',
                                        'exponent' =&gt; '-6',
                                        'forceDebit' =&gt; '0'
                                      },
                       'payerInfo' =&gt; {
                                      'newPayerStatus' =&gt; '2',
                                      'noOfPayerValidity' =&gt; '0',
                                      'prevPayerStatus' =&gt; '2',
                                      'noOfWalletsUsed' =&gt; '0',
                                      'baseWalletBalance' =&gt; '9998000000'
                                    },
                       'pricedInfo' =&gt; {
                                       'totalUsedUnits' =&gt; '0',
                                       'taxingOptionUsed' =&gt; '0',
                                       'totalSalePrice' =&gt; '0',
                                       'totalTax' =&gt; '0',
                                       'totalCostPrice' =&gt; '0',
                                       'chargeSummary' =&gt; {
                                                          'dimensionSummary' =&gt; {
                                                                                'dimensionId' =&gt; '0',
                                                                                'componentSummary' =&gt; {
                                                                                                      'totalSalePrice' =&gt; '0',
                                                                                                      'totalCostPrice' =&gt; '0',
                                                                                                      'componentId' =&gt; '0',
                                                                                                      'totalDiscountAmount' =&gt; '0',
                                                                                                      'bucketsUsed' =&gt; '0'
                                                                                                    }
                                                                              }
                                                        },
                                       'totalDiscountAmount' =&gt; '0',
                                       'bucketsUsed' =&gt; '0'
                                     }
                     },
                     {
                       'networkInfo' =&gt; {
                                        'extPayer' =&gt; '50351851444',
                                        'instanceId' =&gt; '0',
                                        'imei' =&gt; '0',
                                        'passwordId' =&gt; '0',
                                        'networkUsageIdentifier' =&gt; '67060224951',
                                        'ReleaseCause' =&gt; '01144',
                                        'spendControlId' =&gt; '0',
                                        'defaultPayer' =&gt; '50351851444',
                                        'sessionId' =&gt; '1510141545000003101',
                                        'chargingGroupNumberDiscountPercent' =&gt; '0',
                                        'errorCode' =&gt; '0',
                                        'calledPartyAddress' =&gt; '0050399051801',
                                        'callingPartyAddress' =&gt; '0050351851444',
                                        'semiAutoCollectClassId' =&gt; '0',
                                        'destinationZoneCode' =&gt; '1021',
                                        'requestType' =&gt; '1001',
                                        'redirectingPartyId' =&gt; '',
                                        'ApplicationServer' =&gt; '7060261771',
                                        'chargingGroupDiscountPercent' =&gt; '0',
                                        'timeZone' =&gt; '+1Q',
                                        'chargingGroupClass' =&gt; '0',
                                        'ccRequestType' =&gt; '3',
                                        'defaultExtPayer' =&gt; '50351851444',
                                        'carrierCode' =&gt; '',
                                        'PrefixDialled' =&gt; '',
                                        'dialingType' =&gt; '99',
                                        'connectionType' =&gt; '0',
                                        'mcc' =&gt; '706',
                                        'locationInfo' =&gt; '2495100001',
                                        'originalCalledPartyId' =&gt; '',
                                        'specialNumberClassId' =&gt; '0',
                                        'eventDateTime' =&gt; '20151014154535',
                                        'bearerService' =&gt; '0',
                                        'smscRefernceNumber' =&gt; '',
                                        'sequenceNumber' =&gt; '0',
                                        'redirectionInformation' =&gt; '',
                                        'unitType' =&gt; '0',
                                        'connectTime' =&gt; '20151014154535',
                                        'holidayCode' =&gt; '0',
                                        'imsi' =&gt; '51851444',
                                        'serviceIdentifier' =&gt; '0',
                                        'ratingZoneType' =&gt; '1',
                                        'mscAddress' =&gt; '',
                                        'enterpriseCall' =&gt; '0',
                                        'isTollFree' =&gt; '0',
                                        'specialLocationClassId' =&gt; '0',
                                        'routingNumber' =&gt; '',
                                        'eventType' =&gt; '0',
                                        'payerType' =&gt; '0',
                                        'connectionId' =&gt; '0050351851444',
                                        'payer' =&gt; '50351851444',
                                        'subscriberClass' =&gt; '0',
                                        'chargingGroupId' =&gt; '0',
                                        'callReferenceNumber' =&gt; '3031303032303031',
                                        'mvnoId' =&gt; '2',
                                        'originatingNetworkId' =&gt; '1021',
                                        'callType' =&gt; '1',
                                        'dialDigitId' =&gt; '1041',
                                        'actionDateTime' =&gt; '20151014154535',
                                        'callTerminationCause' =&gt; '1',
                                        'vpnGroupId' =&gt; '0',
                                        'mnc' =&gt; '02',
                                        'exponent' =&gt; '-6'
                                      },
                       'payerInfo' =&gt; {
                                      'newPayerStatus' =&gt; '2',
                                      'noOfPayerValidity' =&gt; '0',
                                      'prevPayerStatus' =&gt; '2',
                                      'walletDetails' =&gt; {
                                                         'walletId' =&gt; '1',
                                                         'prevWalletBalance' =&gt; '10000000000',
                                                         'prevExpiryDate' =&gt; '20991231',
                                                         'expiryFlag' =&gt; '0',
                                                         'newWalletBalance' =&gt; '9998000000',
                                                         'newExpiryDate' =&gt; '20991231'
                                                       },
                                      'noOfWalletsUsed' =&gt; '1',
                                      'baseWalletBalance' =&gt; '9998000000'
                                    },
                       'pricedInfo' =&gt; {
                                       'totalUsedUnits' =&gt; '120',
                                       'totalCostPrice' =&gt; '2000000',
                                       'bucket' =&gt; {
                                                   'rateId' =&gt; '1002',
                                                   'discountPercentage' =&gt; '0',
                                                   'startUnits' =&gt; '1',
                                                   'exchangeRate' =&gt; '1000000',
                                                   'taxFormulaId' =&gt; '1002',
                                                   'componentId' =&gt; '0',
                                                   'taxWalletId' =&gt; '1',
                                                   'currencyRateId' =&gt; '1',
                                                   'discountArticleId' =&gt; '1001',
                                                   'walletId' =&gt; '1',
                                                   'salePrice' =&gt; '2000000',
                                                   'discountAmount' =&gt; '0',
                                                   'TaxDetail' =&gt; {
                                                                  'Tax' =&gt; {
                                                                           'amount' =&gt; '0',
                                                                           'count' =&gt; '1',
                                                                           'article' =&gt; '1009'
                                                                         }
                                                                },
                                                   'usedUnits' =&gt; '120',
                                                   'endUnits' =&gt; '120',
                                                   'taxApplied' =&gt; '0',
                                                   'debitedValue' =&gt; '2000000',
                                                   'costPrice' =&gt; '2000000',
                                                   'dimensionId' =&gt; '0',
                                                   'serviceKey' =&gt; '0',
                                                   'chargeArticleId' =&gt; '1',
                                                   'tariffId' =&gt; '1026'
                                                 },
                                       'taxingOptionUsed' =&gt; '0',
                                       'totalTax' =&gt; '0',
                                       'totalSalePrice' =&gt; '2000000',
                                       'chargeSummary' =&gt; {
                                                          'dimensionSummary' =&gt; {
                                                                                'dimensionId' =&gt; '0',
                                                                                'componentSummary' =&gt; {
                                                                                                      'totalSalePrice' =&gt; '2000000',
                                                                                                      'totalCostPrice' =&gt; '2000000',
                                                                                                      'componentId' =&gt; '0',
                                                                                                      'totalDiscountAmount' =&gt; '0',
                                                                                                      'bucketsUsed' =&gt; '1'
                                                                                                    }
                                                                              }
                                                        },
                                       'bucketsUsed' =&gt; '1',
                                       'totalDiscountAmount' =&gt; '0'
                                     }
                     }
                   ]
          };
  </code></pre>
  
  <p>I want to retrieve <code>requestType</code> from every <code>networkInfo</code> parameter. We have 3 to 4 network info parameter, I want to retrieve only <code>requestType=1001</code>. How can I achieve this? </p>
  
  <p>I am using XML::Simple and I want to stick with that only.</p>