Because on image exit the default was not changed.
In this case the relevant image is perl.exe (and also
loaded sharables like perlshr.exe).  If you want
the perl script to leave you in a directory $x then
you should use the setdef() routine from the VMS::Stdio
module.  The documentation is at:

http://search.cpan.org/author/JHI/perl-5.8.0/vms/ext/Stdio/Stdio.pm

And your code could look like:

  use VMS::Stdio qw( &setdef );
  # code here sets the value of $x presumably
  setdef( $x );

Peter Prymmer



                                                                                       
                                        
                      "Sandy Fleming"                                                  
                                        
                      <[EMAIL PROTECTED]         To:      <[EMAIL PROTECTED]>             
                                        
                      emon.co.uk>              cc:                                     
                                        
                                                                                       
                                        
                      09/03/2002 01:20         Subject: Set Default not Working        
                                        
                      PM                                                               
                                        
                      Please respond                                                   
                                        
                      to sandy                                                         
                                        
                                                                                       
                                        
                                                                                       
                                        



Folks,

I'm new to using Perl in VMS, not quite so new to Perl itself.

I've been using the following as given by David Lyon in the Perl FAQ at
http://www.sidhe.org/vmsperl/vmsperlfaq.html#Q12

open(OUT,"|\@sys\$input"); # mind the backslash in sys$input
print OUT "show default\n"; # or any other command
print OUT "dir/date"; # or any other command
close(OUT);

It works bery nicely with these commands, but I can't get it to work with
SET DEFAULT at all:

open(OUT,"|\@sys\$input");
print OUT "set default $x\n";
close(OUT);

Where the variable $x holds the directory path as a string. This gives no
errors, it just doesn't change the directory default.

The following works fine for displaying the directory even with exactly the
same string in $x:

open(OUT,"|\@sys\$input");
print OUT "directory $x\n";
close(OUT);

Does anyone know why the SET DEFAULT command doesn't work here?

Sandy Fleming
http://scotstext.org/








Reply via email to