Hi list, The following code fragment works but has a horrible feel about it, can anyone suggest ways to improve it.
The data structure is generated by an XML parser. for ( keys %{$parsed_data->{value}->{NetworkServices}->{value}} ) { if ( $parsed_data->{value}->{NetworkServices}->{value}->{$_}->{value}->{Inter face}->{value}->{DeviceName}->{value} eq "modem" and $parsed_data->{value}->{NetworkServices}->{value}->{$_}->{value}->{PPP}- >{value}->{UserDefinedName}->{value} eq $serviceName) { print "found correct modem\n"; $parsed_data->{value}->{NetworkServices}->{value}->{$_}->{value}->{PPP}- >{value}->{AuthName}->{value} = $username; } } Ta very much, Brian :-( BBCi at http://www.bbc.co.uk/ This e-mail (and any attachments) is confidential and may contain personal views which are not the views of the BBC unless specifically stated. If you have received it in error, please delete it from your system, do not use, copy or disclose the information in any way nor act in reliance on it and notify the sender immediately. Please note that the BBC monitors e-mails sent or received. Further communication will signify your consent to this.