#!/perl/bin/perl # # RegPeek.pl -- Q&D dump of registry information. use strict; use warnings; use diagnostics; use Win32::Registry; for ("HARDWARE\\DEVICEMAP\\Scsi","SYSTEM\\CurrentControlSet\\Enum\\IDE") { print "$_\n"; ShowSubKeys($HKEY_LOCAL_MACHINE,$_,1); } sub ShowSubKeys { my ($h,$s,$level) = @_; my $hkey; my @subkeys; my %values; $h->Open($s,$hkey); $hkey->GetKeys(\@subkeys); if (@subkeys) { for (@subkeys) { print "", ' ' x ($level * 2),"$_\n"; ShowSubKeys($h,"$s\\$_",$level + 1); } } $hkey->GetValues(\%values); for (keys %values) { my ($name,$type,$value) = @{$values{$_}}; print "", ' ' x ($level * 2),"\"$name\" = \"$value\"\n" if $type eq '1'; } }