The other subroutine where this data is receiving is as following:if ($csData->{'CUSTOMER_INVOICE_DETAILS'}) { $c->log->debug("API Response:". Dumper $csData->{'CUSTOMER_INVOICE_DET +AILS'}); my $Charges = []; my @customerCharges = $csData->{'CUSTOMER_INVOICE_DETAILS'}; foreach(@customerCharges) { my ($customername,$customeramount) = split /:/; my $charge_hash = ({ customername => $customername, customeramount => $customeramount }); push(@$Charges, $charge_hash); } my @ReturnCharges = $self->API->get_customer_charges($Charges, $Custom +er->customerid, $params->{'invoiceid'});
Where I am printing server log for CUSTOMER_INVOICE_DETAILS variable I am getting the following values:sub get_customer_charges { my $self = shift; my ($charge, $CustomerId, $INID) = @_; my $http_request = { action => 'GetTariff', customerid => $CustomerId, csid => $INID, }; my $markups = $self->APIRequest($http_request); ##‪#‎Charge‬ Level ID Inserting As 10 my @ChargeLevels; my @BaseLevelID; foreach my $ch (@$charge) { my ($customername,$customeramount) = split(':', $ch->{'customername'}, + $ch->{'customername'}); my $chargelevel = join(':', $ch->{'customername'}, $ch->{'customeramou +nt'}, '10'); push(@BaseLevelID, $chargelevel); } push(@ChargeLevels, @BaseLevelID); return @ChargeLevels; }
After sending data to second subroutine the data coming in server log for second subroutine variable is as following: Charges in API:$VAR1 = 'HASH(0xb75d6d8)::10'; Can anyone help how could I send the hash data from one subroutine to another? Thanks in advance.API Response:$VAR1 = { 'Product' => '34.04', 'basetax' => '2.38', 'vattax' => '4.36' };
In reply to Convert Hash To Array in Perl Catalyst by jphani225
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |