--- installed.pm;1	Thu Jan 23 14:22:27 2003
+++ installed.pm;0	Wed Mar 26 23:14:09 2003
@@ -105,19 +105,60 @@
         $module =~ s!\Q$sitearch\E/?auto/(.*)/.packlist!$1!s;
         my $modfile = "$module.pm";
         $module =~ s!/!::!g;
 
         # Find the top-level module file in @INC
-        $self->{$module}{version} = '';
+
+        my $version_temp = '';
+
         foreach my $dir (@INC) {
             my $p = File::Spec->catfile($dir, $modfile);
             if (-f $p) {
                 require ExtUtils::MM;
-                $self->{$module}{version} = MM->parse_version($p);
+                $version_temp = MM->parse_version($p);
+
+                if ($^O eq 'VMS') {
+                    # Under VMS, the package name
+                    # cannot be reconstructed from
+                    # the directory name, since the
+                    # uppercase/lowercase
+                    # information is lost ($module is
+                    # all lowercase here). Instead,
+                    # we try to open the .pm file
+                    # and look for the 'package
+                    # <package name>;' line. If
+                    # this is found, the <package
+                    # name> will be used. 
+
+                    my $pack;
+                    if (open PACKFH, $p) {
+                        while (<PACKFH>) {
+                            if (/package (.*:)?([^:]+);/) {
+                                $pack = $2;
+                                # Make a sanity check, that lower case $module
+                                # is identical to lowercase $pack before
+                                # accepting it
+                                if (lc($pack) eq lc($module)) {
+                                    $module = $pack;
+                                    last;
+                                }
+                            }
+                        }
+                        close PACKFH;
+                    }
+                    else {
+                        # Should not occur, since 'if (-f $p)' above
+                        # has succeeded
+                        print "Installed.pm: Could not open $p\n";
+                    }
+                } # VMS specific
+
                 last;
             }
         }
+
+        $self->{$module}{version} = $version_temp;
 
         # Read the .packlist
         $self->{$module}{packlist} = 
           ExtUtils::Packlist->new($File::Find::name);
     };
