On 21 Aug 2007, at 04:55, John E. Malmberg wrote:

The load conditional code does a require using the VMS format, and since it does not match the key in UNIX format, modules can be loaded twice. This showed up by causing the extract tests to emit diagnostics about routines being overridden.

This patch forces the %INC key to be in UNIX format so that the modules will not be loaded twice.

In 01_Module_Load.t, on VMS, the $file for the module will now be returned in UNIX format.

In 01_Module_Load_Conditional.t, some work arounds are needed for issues with VMS handling of UNIX pathnames incorrectly.

Since MLC uses Module::Load, wouldn't it just be an easier fix to always unixify paths on VMS?

How does this patch look for you?

--- local/oss/module-load/lib/Module/Load.pm    (revision 2064)
+++ local/oss/module-load/lib/Module/Load.pm    (revision 2065)
@@ -1,6 +1,6 @@
 package Module::Load;

-$VERSION = '0.10';
+$VERSION = '0.12';

 use strict;
 use File::Spec ();
@@ -56,6 +56,13 @@
                     : File::Spec->catfile( @parts );

     $file   .= '.pm' if $pm;
+
+    ### on perl's before 5.10 ([EMAIL PROTECTED]) if you require
+    ### a file in VMS format, it's stored in %INC in VMS
+    ### format. Therefor, better unixify it first
+    ### Patch in reply to John Malmbergs patch (as mentioned
+    ### above) on p5p Tue 21 Aug 2007 04:55:07
+    $file = VMS::Filespec::unixify($file) if $^O eq 'VMS';

     return $file;
 }


--
Jos I. Boumans                 RIPE Network Coordination Center
Database Group Manager         Singel 258 Amsterdam NL
http://www.ripe.net            +31 20 535 4444


Reply via email to