use Win32::TieRegistry( Delimiter=>"/" ); unless( $remoteKey= $Registry->{"//$pserver/LMachine/SYSTEM/" . "CurrentControlSet/Control/Print/Monitors/"} and $remoteKey->SubKeyNames() and $remoteKey= $remoteKey->{"HP Standard TCP/IP Port/"} and $remoteKey= $remoteKey->{"Ports/$portname/"} ) { die "Can't read the port key on $pserver: $^E\n"; } #### use Win32::TieRegistry( Delimiter=>"/" ); $remoteKey = $Registry->Open( "##$pserver#LMachine#SYSTEM#" . "CurrentControlSet#Control#Print#Monitors#" . "HP Standard TCP/IP Port#Ports#$portname#", { Delimiter=>"#" } ) or die "Can't read the port key on $pserver: $^E\n";