June Young writes:

> I just installed perl56 on vms Alpha 7.21 and encounter the following
> problem of system command in perl while piping output to a file.
>
> source code test.prl:
> system("SORT jy.tmp  temp.tmp");
>
> This script runs OK if I do not pipe STDOUT to a file.
>
> test result:
> ------------
> $perl test.prl
> $type temp.tmp
> aa
> bb
> cc
>
> $del temp.tmp;
>
> The script will not create temp.tmp if I pipe the STDOUT to a file
> $perl test.prl >temp2.tmp
> $type temp.tmp
> %TYPE-W-SEARCHFAIL, error searching for DSA0:[JY]TEMP.TMP;
> -RMS-E-FNF, file not found

I just tried this with a development Perl (5.7.0 patch 8585) and it
worked fine both redirected and not:

$ perl -e"system('sort jy.tmp foo.tmp');"                  # was ok
$ perl -e"system('sort jy.tmp foo.tmp');"  >bar.tmp        # was ok

You might want to try:

    #! perl
    use vmsish 'status';
    system('sort jy.tmp foo.tmp');
    print "My status was: $?  extended status $^E\n";

since it seems likely that your subprocess is dying before doing anything.

> I even edit vmspipe.com and replace
> $ pif perl_popen_out .nes. "" then perl_define  sys$output 'perl_popen_out'
> with
> $ pif perl_popen_out .nes. "" then perl_define/user/name_attributes=confine 
>sys$output 'perl_popen_out'
> and still get the same answer.

This certainly won't have any affect: the perl system() function doesn't
use VMSPIPE.COM at all.
--
 Drexel University       \V                    --Chuck Lane
======]---------->--------*------------<-------[===========
     (215) 895-1545     _/ \  Particle Physics
FAX: (215) 895-5934     /\ /~~~~~~~~~~~        [EMAIL PROTECTED]

Reply via email to