Hello,
do you know a possibility to set the actual directory inside a Perl script
(chdir my_dir;) to get it changed in the command shell outside the
script?
setDir.pl:
# some code to set $MyDir
chdir $MyDir;
exit 0;
Command line:
setDir.pl
Regards,
Martin
() function.
-Original Message-
From: Adam Ingerman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 8:05 AM
To: [EMAIL PROTECTED]
Subject: Re: Setting the actual directory with a Perl script.
Hello,
do you know a possibility to set the actual directory inside a Perl
script
Adam Ingerman [EMAIL PROTECTED] wrote:
[[EMAIL PROTECTED] wrote:]
do you know a possibility to set the actual directory inside a Perl
script (chdir my_dir;) to get it changed in the command shell
outside the script?
easiest way, tell the shell to do it for you. if you're on windows,
;
- Original Message -
From: Stovall, Adrian M. [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Wednesday, September 25, 2002 9:33 AM
Subject: RE: Setting the actual directory with a Perl script.
That won't quite work...
#!perl -w
use Cwd;
print cwd.\n; #print the starting directory
]
|
| Kopie:
|
| Thema: RE: Setting the actual directory with a Perl script
, though). :)
HTH
Adrian
cwd.bat
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 25, 2002 8:44 AM
To: [EMAIL PROTECTED]
Subject: Re: Setting the actual directory with a Perl script.
Hello,
thats not exactly the behaviour I wanted
]'
Subject: RE: Setting the actual directory with a Perl script.
That took a bit of thinking...Three lines:
#!perl -w
$chdir = c:\\winnt; #or whatever code you
want to pick a directory
system(start /B direct.bat $chdir); #go to that directory
Sometimes it's easier to lean