http://qs321.pair.com?node_id=211047

Discipulus has asked for the wisdom of the Perl Monks concerning the following question:

Hello monks!!

I'm in fix! I have a sub called findodbc. I pass to it an IP I want to build an hash where keyes are the paths in the Data Base Qualifier {DBQ} and where the values are the DSN.
When I manually use regedit->conect remote registry I 'm able to view ODBC/ODBC.INI and all remote sistem DSN.
When I launch the same code locally it's all ok.

BUT when my sub run from remote I can view only
ODBC Data Sources/ and ODBC File DSN/ that are useless.
I have tried to connect to the remote machine too and to call the script "locally" and read out the data with some results.
use Win32::TieRegistry ( Delimiter=>"/" ); [...] sub findodbc { $lista= $Registry->Connect( "$ip", "LMachine" )or die "Can't connect +to HostA's HKEY_LOCAL_MACHINE key: $^E\n"; $lista=$Registry->{"HKEY_LOCAL_MACHINE/Software/ODBC/ODBC.INI"}or di +e "$^E\n"; foreach $nom(keys (%$lista)) { print $nom; chop $nom; $coso= $Registry->{"HKEY_LOCAL_MACHINE/Software/ODBC/ODBC.INI/$nom"} +or die "$^E\n"; print "\n$nom\t".$coso->{DBQ}or die $!; if (defined $coso->{DBQ}) { if($coso->{DBQ}=~/\\([\w -]+\\)(database\\)(\w+\.mdb)/){$odbc{$1.$3 +}=$nom} } while (($k, $v)=each(%odbc)){print "$k--------$v\n"} } exit; }
greetings from sunny but cold roma

lor*