show resource usage context brn0ace01 bandwidth 2744 conn 500 #### use XML::Simple qw(:strict); my $xml = XMLin($tmpfile, ForceArray => 0, SuppressEmpty => 1, KeyAttr => 'ru_resource' ); my $bandwidth = $xml->{exec_command}->{xml_show_result}->{xml_show_resource_usage}->{ru_entry}->{bandwidth}->{ru_current}; print $bandwidth; #### $VAR1 = { 'exec_command' => { 'xml_show_result' => { 'xml_show_resource_usage' => { 'ru_entry' => { 'conn ' => { 'ru_current' => ' 500' }, 'bandwidth ' => { 'ru_current' => ' 2744' } } } }, 'status' => { 'text' => 'XML_CMD_SUCCESS', 'code' => '100' }, 'command' => ' show resource usage context brn0ace01 ' } };