Greetings,

The following patch was originally presented to the vmsperl list
 in a message in the archive at:

http://www.xray.mpe.mpg.de/mailing-lists/vmsperl/2003-06/msg00035.html

Although some work with vmspipe.com is currently being planned
I wanted to ensure that this quick fix made it in to 5.8.1 if possible.
I have an interesting regression test of the environment <-> perl
interaction that is fixed with this patch, but unfortunately I cannot
test it on older versions of VMS hence cannot include it here
(the test could potentially indicate false failures on older versions
of VMS).

Files affected:
    vms/vms.c
   vms/vmspipe.com

In clear text:
diff -ru perl/vms/vms.c perl_19956/vms/vms.c
--- perl/vms/vms.c      2003-04-17 15:30:12.000000000 -0400
+++ perl_19956/vms/vms.c      2003-07-03 23:55:19.120001000 -0400
@@ -2299,7 +2299,7 @@
     }
     if (!fp) return 0;  /* we're hosed */

-    fprintf(fp,"$! 'f$verify(0)\n");
+    fprintf(fp,"$! 'f$verify(0)'\n");
     fprintf(fp,"$!  ---  protect against nonstandard definitions ---\n");
     fprintf(fp,"$ perl_cfile  = f$environment(\"procedure\")\n");
     fprintf(fp,"$ perl_define = \"define/nolog\"\n");
@@ -2317,16 +2317,8 @@
     fprintf(fp,"$c=c+perl_popen_cmd2\n");
     fprintf(fp,"$x=perl_popen_cmd3\n");
     fprintf(fp,"$c=c+x\n");
-    fprintf(fp,"$!  --- get rid of global symbols\n");
-    fprintf(fp,"$ perl_del/symbol/global perl_popen_in\n");
-    fprintf(fp,"$ perl_del/symbol/global perl_popen_err\n");
-    fprintf(fp,"$ perl_del/symbol/global perl_popen_out\n");
-    fprintf(fp,"$ perl_del/symbol/global perl_popen_cmd0\n");
-    fprintf(fp,"$ perl_del/symbol/global perl_popen_cmd1\n");
-    fprintf(fp,"$ perl_del/symbol/global perl_popen_cmd2\n");
-    fprintf(fp,"$ perl_del/symbol/global perl_popen_cmd3\n");
     fprintf(fp,"$ perl_on\n");
-    fprintf(fp,"$ 'c\n");
+    fprintf(fp,"$ 'c'\n");
     fprintf(fp,"$ perl_status = $STATUS\n");
     fprintf(fp,"$ perl_del  'perl_cfile'\n");
     fprintf(fp,"$ perl_exit 'perl_status'\n");
@@ -2358,7 +2350,11 @@
 {
     static int handler_set_up = FALSE;
     unsigned long int sts, flags = CLI$M_NOWAIT;
-    unsigned int table = LIB$K_CLI_GLOBAL_SYM;
+    /* The use of a GLOBAL table (as was done previously) rendered
+     * Perl's qx() or `` unusable from a C<$ SET SYMBOL/SCOPE=NOGLOBAL> DCL
+     * environment.  Hence we've switched to LOCAL symbol table.
+     */
+    unsigned int table = LIB$K_CLI_LOCAL_SYM;
     int j, wait = 0;
     char *p, mode[10], symbol[MAX_DCL_SYMBOL+1], *vmspipe;
     char in[512], out[512], err[512], mbx[512];
diff -ru perl/vms/vmspipe.com perl_19956/vms/vmspipe.com
--- perl/vms/vmspipe.com      2003-01-23 09:24:41.000000000 -0500
+++ perl_19956/vms/vmspipe.com      2003-07-03 23:55:05.083004000 -0400
@@ -1,4 +1,4 @@
-$! 'f$verify(0)
+$! 'f$verify(0)'
 $!  ---  protect against nonstandard definitions ---
 $ perl_define = "define/nolog"
 $ perl_on     = "on error then exit $STATUS"
@@ -15,14 +15,6 @@
 $c=c+perl_popen_cmd2
 $x=perl_popen_cmd3
 $c=c+x
-$!  --- get rid of global symbols
-$ perl_del/symbol/global perl_popen_cmd0
-$ perl_del/symbol/global perl_popen_cmd1
-$ perl_del/symbol/global perl_popen_cmd2
-$ perl_del/symbol/global perl_popen_cmd3
-$ perl_del/symbol/global perl_popen_in
-$ perl_del/symbol/global perl_popen_err
-$ perl_del/symbol/global perl_popen_out
 $ perl_on
-$ 'c
+$ 'c'
 $ perl_exit '$STATUS'
End of Patch.

And as an attachment (since I have a wacky email client):

(See attached file: vmspipe.patch)

If that could also be integrated over to bleedperl at this time I'd
appreciate
it and please let me know if the merge is difficult (I don't have an
up to date copy of bleedperl and I will be leaving on vacation this
evening).

I might as well repeat my previous reports: File::Find is broken on VMS
and has been since at least back to perl 5.6.1 (it was not broken in
perl 5.005_02 on VMS).  While I do have a fix so the File::Find does not
have "follow symlinks always" turned on I have not had time to fix the
regression tests that break because of the fix.  ExtUtils::MakeMaker is
also broken: it cannot find files in a distribution (e.g. part of the
Encode
module that ships with perl issue a spurious "Contact the author of this
package" warning during a build of perl.  ExtUtils::MakeMaker does not
install the generated sharable objects from an xs based extension on VMS.
ExtUtils::MakeMaker does not maintain $Package::VERSION or linktype
data in the perllocal.pod file on VMS.  I hope to address many of those
issues on my return.

Peter Prymmer

Attachment: vmspipe.patch
Description: Binary data

Reply via email to