switch vmspipe.com over to using local symbols instead of global
Peter Prymmer [Thu, 3 Jul 2003 23:59:51 +0000 (19:59 -0400)]
Message-ID: <OF4DF4AA68.1EF12116-ON85256D59.00120F5E-85256D59.0015F58D@factset.com>

p4raw-id: //depot/perl@19976

vms/vms.c
vms/vmspipe.com

index 2bcf087..65d1cbb 100644 (file)
--- a/vms/vms.c
+++ b/vms/vms.c
@@ -2269,7 +2269,7 @@ vmspipe_tempfile(pTHX)
     }
     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");
@@ -2287,16 +2287,8 @@ vmspipe_tempfile(pTHX)
     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");
@@ -2328,7 +2320,11 @@ safe_popen(pTHX_ char *cmd, char *in_mode, int *psts)
 {
     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];
index 30ce592..dd23bf9 100644 (file)
@@ -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_cmd1
 $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'