good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re^2: Complicated datastructre and after merging giving numeric value need help!!by nramya82 (Initiate) |
on Oct 23, 2013 at 22:16 UTC ( [id://1059360]=note: print w/replies, xml ) | Need Help?? |
Thank you for your response. Yes it worked but when I tried to print each value I am just getting hash reference and not the value. Below is my code in .pm file I need to produce output like thisfrom the this
My mail .pm files with has the below code </code>sub locallb_get_member_v2 { my $ENABLED_STATUS_MAP = { "ENABLED_STATUS_NONE" => "NONE", "ENABLED_STATUS_ENABLED" => "ENABLED", "ENABLED_STATUS_DISABLED" => "DISABLED", "ENABLED_STATUS_DISABLED_BY_PARENT" => "DISABLED_BY_PARENT", }; my $AVAILABILITY_STATUS_MAP = { 'AVAILABILITY_STATUS_NONE' => 'Error scenario', 'AVAILABILITY_STATUS_GREEN' => 'GREEN', 'AVAILABILITY_STATUS_YELLOW' => 'YELLOW', 'AVAILABILITY_STATUS_RED' => 'RED', 'AVAILABILITY_STATUS_BLUE' => 'BLUE', 'AVAILABILITY_STATUS_GRAY' => 'GRAY', }; push (@status,@memberobjectstatus); my %members; foreach my $member (@status){ $members{ $status->{'address'} = $member->{'port'}}; $members{ $status}->{'enabled'} = $ENABLED_STATUS_MAP->{ $status->{'enabled_status'} } ; $members{ $status}->{'availability'} = $AVAILABILITY_STATUS_MAP->{ $status->{'availability_status'} } ; return \%members; } </code> In main cgi i have the below code
But the above code produce below output
In Section
Seekers of Perl Wisdom
|
|