script/regclassnames.pl untested

filter: Statementstmt 0.0% 0 / 30 Branchbran 0.0% 0 / 6 Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 0.0% 0 / 6 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 53 CC 2 SCAR 11.5
CC
2
Cov
0%
traverse
6.0
usage
2.0
BEGIN
2.0
CRAP 3.1
1 #!/usr/local/bin/perl
2 use strict;
3 use warnings;
4  
5 use File::Basename;
6 use Parse::Win32Registry 0.41;
7  
8 binmode(STDOUT, ':utf8');
9  
10 my $filename = shift or die usage();
11 my $initial_key_path = shift;
12  
13 my $registry = Parse::Win32Registry->new($filename)
14 or die "'$filename' is not a registry file\n";
15 my $root_key = $registry->get_root_key
16 or die "Could not get root key of '$filename'\n";
17  
18 if (defined($initial_key_path)) {
19 $root_key = $root_key->get_subkey($initial_key_path);
20 if (!defined($root_key)) {
21 die "Could not locate the key '$initial_key_path' in '$filename'\n";
22 }
23 }
24  
25 traverse($root_key);
26  
27 sub traverse {
28 my $key = shift;
29  
30 if (my $class_name = $key->get_class_name) {
31 print $key->get_path, " \"$class_name\"\n";
32 }
33  
34 foreach my $subkey ($key->get_list_of_subkeys) {
35 traverse($subkey);
36 }
37 }
38  
39 sub usage {
40 my $script_name = basename $0;
41 return <<USAGE;
42 $script_name for Parse::Win32Registry $Parse::Win32Registry::VERSION
43  
44 Displays those keys in a registry file that have a class name.
45 Only keys in Windows NT registry files may have class names.
46  
47 $script_name <filename> [subkey]
48 USAGE
49 }