bhushanQA has asked for the wisdom of the Perl Monks concerning the following question:
I am having below xml output,
I want to retrieve "requestType" from every 'networkInfo' parameter, we have 3 to 4 network info parameter, I want to retrieve only "requestType"= 1001, How Can I achieve this ?
I am using xml:simple and I want to stick with that only.. pls help.
$VAR1 = { 'cdr' => [ { 'networkInfo' => { 'extPayer' => '50351851444', 'eventSource' => 'J@nus', 'sequenceNumber' => '0', 'connectionId' => '0050351851444 +', 'payer' => '50351851444', 'status' => '1', 'mvnoId' => '2', 'currentStatus' => '2', 'eventReferenceNumber' => '15101 +41545000003101', 'sessionId' => '1510143920000000 +011', 'errorCode' => '0', 'previousStatus' => '1', 'eventDateTime' => '201510141545 +33', 'requestType' => '51', 'actionDateTime' => '20151014154 +533', 'exponent' => '-6' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '1', 'noOfWalletsUsed' => '0', 'baseWalletBalance' => '0' }, 'pricedInfo' => { 'totalUsedUnits' => '0', 'taxingOptionUsed' => '0', 'totalSalePrice' => '0', 'totalTax' => '0', 'totalCostPrice' => '0', 'chargeSummary' => { 'dimensionSumm +ary' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '0', + 'totalCostPrice' => '0', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '0' + } + } }, 'totalDiscountAmount' => '0', 'bucketsUsed' => '0' } }, { 'networkInfo' => { 'extPayer' => '50351851444', 'eventSource' => 'J@nus', 'sequenceNumber' => '0', 'connectionId' => '0050351851444 +', 'payer' => '50351851444', 'status' => '1', 'mvnoId' => '2', 'currentStatus' => '2', 'eventReferenceNumber' => '15101 +41545000003101', 'sessionId' => '1510143920000000 +021', 'errorCode' => '0', 'previousStatus' => '2', 'eventDateTime' => '201510141545 +35', 'requestType' => '53', 'actionDateTime' => '20151014154 +535', 'exponent' => '-6' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '2', 'noOfWalletsUsed' => '0', 'baseWalletBalance' => '0' }, 'pricedInfo' => { 'totalUsedUnits' => '0', 'taxingOptionUsed' => '0', 'totalSalePrice' => '0', 'totalTax' => '0', 'totalCostPrice' => '0', 'chargeSummary' => { 'dimensionSumm +ary' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '0', + 'totalCostPrice' => '0', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '0' + } + } }, 'totalDiscountAmount' => '0', 'bucketsUsed' => '0' } }, { 'networkInfo' => { 'extPayer' => '50351851444', 'eventSource' => 'J@nus', 'sequenceNumber' => '0', 'connectionId' => '0', 'payer' => '50351851444', 'status' => '1', 'mvnoId' => '2', 'currentStatus' => '2', 'eventReferenceNumber' => '0', 'sessionId' => '2015101400000335 +940', 'errorCode' => '0', 'previousStatus' => '2', 'eventDateTime' => '201510141545 +40', 'requestType' => '3', 'actionDateTime' => '20151014154 +535', 'exponent' => '-6', 'forceDebit' => '0' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '2', 'noOfWalletsUsed' => '0', 'baseWalletBalance' => '9998000000 +' }, 'pricedInfo' => { 'totalUsedUnits' => '0', 'taxingOptionUsed' => '0', 'totalSalePrice' => '0', 'totalTax' => '0', 'totalCostPrice' => '0', 'chargeSummary' => { 'dimensionSumm +ary' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '0', + 'totalCostPrice' => '0', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '0' + } + } }, 'totalDiscountAmount' => '0', 'bucketsUsed' => '0' } }, { 'networkInfo' => { 'extPayer' => '50351851444', 'instanceId' => '0', 'imei' => '0', 'passwordId' => '0', 'networkUsageIdentifier' => '670 +60224951', 'ReleaseCause' => '01144', 'spendControlId' => '0', 'defaultPayer' => '50351851444', 'sessionId' => '1510141545000003 +101', 'chargingGroupNumberDiscountPerc +ent' => '0', 'errorCode' => '0', 'calledPartyAddress' => '0050399 +051801', 'callingPartyAddress' => '005035 +1851444', 'semiAutoCollectClassId' => '0', 'destinationZoneCode' => '1021', 'requestType' => '1001', 'redirectingPartyId' => '', 'ApplicationServer' => '70602617 +71', 'chargingGroupDiscountPercent' = +> '0', 'timeZone' => '+1Q', 'chargingGroupClass' => '0', 'ccRequestType' => '3', 'defaultExtPayer' => '5035185144 +4', 'carrierCode' => '', 'PrefixDialled' => '', 'dialingType' => '99', 'connectionType' => '0', 'mcc' => '706', 'locationInfo' => '2495100001', 'originalCalledPartyId' => '', 'specialNumberClassId' => '0', 'eventDateTime' => '201510141545 +35', 'bearerService' => '0', 'smscRefernceNumber' => '', 'sequenceNumber' => '0', 'redirectionInformation' => '', 'unitType' => '0', 'connectTime' => '20151014154535 +', 'holidayCode' => '0', 'imsi' => '51851444', 'serviceIdentifier' => '0', 'ratingZoneType' => '1', 'mscAddress' => '', 'enterpriseCall' => '0', 'isTollFree' => '0', 'specialLocationClassId' => '0', 'routingNumber' => '', 'eventType' => '0', 'payerType' => '0', 'connectionId' => '0050351851444 +', 'payer' => '50351851444', 'subscriberClass' => '0', 'chargingGroupId' => '0', 'callReferenceNumber' => '303130 +3032303031', 'mvnoId' => '2', 'originatingNetworkId' => '1021' +, 'callType' => '1', 'dialDigitId' => '1041', 'actionDateTime' => '20151014154 +535', 'callTerminationCause' => '1', 'vpnGroupId' => '0', 'mnc' => '02', 'exponent' => '-6' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '2', 'walletDetails' => { 'walletId' => ' +1', 'prevWalletBala +nce' => '10000000000', 'prevExpiryDate +' => '20991231', 'expiryFlag' => + '0', 'newWalletBalan +ce' => '9998000000', 'newExpiryDate' + => '20991231' }, 'noOfWalletsUsed' => '1', 'baseWalletBalance' => '9998000000 +' }, 'pricedInfo' => { 'totalUsedUnits' => '120', 'totalCostPrice' => '2000000', 'bucket' => { 'rateId' => '1002', 'discountPercentage' +=> '0', 'startUnits' => '1', 'exchangeRate' => '10 +00000', 'taxFormulaId' => '10 +02', 'componentId' => '0', 'taxWalletId' => '1', 'currencyRateId' => ' +1', 'discountArticleId' = +> '1001', 'walletId' => '1', 'salePrice' => '20000 +00', 'discountAmount' => ' +0', 'TaxDetail' => { 'Tax' +=> { + 'amount' => '0', + 'count' => '1', + 'article' => '1009' + } }, 'usedUnits' => '120', 'endUnits' => '120', 'taxApplied' => '0', 'debitedValue' => '20 +00000', 'costPrice' => '20000 +00', 'dimensionId' => '0', 'serviceKey' => '0', 'chargeArticleId' => +'1', 'tariffId' => '1026' }, 'taxingOptionUsed' => '0', 'totalTax' => '0', 'totalSalePrice' => '2000000', 'chargeSummary' => { 'dimensionSumm +ary' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '2000000', + 'totalCostPrice' => '2000000', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '1' + } + } }, 'bucketsUsed' => '1', 'totalDiscountAmount' => '0' } } ] };
|
---|
Back to
Seekers of Perl Wisdom