Thanks Pijo for help..!! It was working perfect if we take Array reference and multiple attributes present in the same file. But this is failing only one attribute is present in the file.. it says not an array reference.Below is my xml data dumper o/p.
$VAR1 = { 'cdr' => { 'networkInfo' => { 'extPayer' => '13000', 'ggsnAddress' => '172.26.33.44', 'instanceId' => '0', 'imei' => '0', 'networkUsageIdentifier' => '172.2 +6.33.44', 'ReleaseCause' => '00144', 'spendControlId' => '0', 'defaultPayer' => '13000', 'gprsLocationInfo' => '0130120857' +, 'sessionId' => '151014195900000010 +1', 'errorCode' => '0', 'requestType' => '1001', 'timeZone' => '', 'ccRequestType' => '3', 'defaultExtPayer' => '13000', 'sgsnAddress' => '172.26.33.44', 'gprsLBC' => '0', 'gprsApn' => 'tecnotree.com', 'connectionType' => '0', 'gprsAttributes' => '', 'eventDateTime' => '20151014195959 +', 'imsiMccMnc' => '724110000000069', 'sequenceNumber' => '0', 'unitType' => '2', 'holidayCode' => '0', 'serviceIdentifier' => '0', 'ratingGroup' => '1029', 'pdpType' => '0', 'pdpAddress' => '172.26.33.44', 'sgsnMccMnc' => '', 'specialLocationClassId' => '0', 'eventType' => '0', 'payerType' => '0', 'connectionId' => '005029740902190 +', 'payer' => '13000', 'cgAddress' => '', 'redirectionCode' => '0', 'callReferenceNumber' => '11499269 +2', 'ggsnMccMnc' => '', 'mvnoId' => '3', 'originatingNetworkId' => '1081', 'chargingId' => '114992692', 'actionDateTime' => '2015101419595 +9', 'tariffToken' => '0', 'callTerminationCause' => '1', 'exponent' => '-6' }, 'payerInfo' => { 'newPayerStatus' => '2', 'noOfPayerValidity' => '0', 'prevPayerStatus' => '2', 'walletDetails' => { 'walletId' => '1' +, 'prevWalletBalanc +e' => '9856000000000', 'prevExpiryDate' +=> '20151202', 'expiryFlag' => ' +0', 'newWalletBalance +' => '9854000000000', 'newExpiryDate' = +> '20151202' }, 'noOfWalletsUsed' => '1', 'baseWalletBalance' => '985400000000 +0' }, 'pricedInfo' => { 'totalUsedUnits' => '2000', 'totalCostPrice' => '2000000000', 'bucket' => { 'rateId' => '1347', 'discountPercentage' => + '0', 'startUnits' => '1', 'exchangeRate' => '1000 +000', 'taxFormulaId' => '1002 +', 'componentId' => '0', 'taxWalletId' => '1', 'currencyRateId' => '1' +, 'discountArticleId' => +'1001', 'walletId' => '1', 'salePrice' => '2000000 +000', 'discountAmount' => '0' +, 'TaxDetail' => { 'Tax' => + { + 'amount' => '0', + 'count' => '1', + 'article' => '1009' } }, 'usedUnits' => '2000', 'endUnits' => '2000', 'taxApplied' => '0', 'debitedValue' => '2000 +000000', 'costPrice' => '2000000 +000', 'dimensionId' => '0', 'serviceKey' => '0', 'chargeArticleId' => '1 +', 'tariffId' => '1422' }, 'taxingOptionUsed' => '0', 'totalTax' => '0', 'totalSalePrice' => '2000000000', 'chargeSummary' => { 'dimensionSummar +y' => { + 'dimensionId' => '0', + 'componentSummary' => { + 'totalSalePrice' => '2000000000', + 'totalCostPrice' => '2000000000', + 'componentId' => '0', + 'totalDiscountAmount' => '0', + 'bucketsUsed' => '1' + } + } }, 'bucketsUsed' => '1', 'totalDiscountAmount' => '0' } } };

In reply to Re^4: Perl : How to retrieve from xml when xml file having same attribute multiple time by bhushanQA
in thread Perl : How to retrieve from xml when xml file having same attribute multiple time by bhushanQA

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.