In my perl script, use chdir
command from Perl iteself works well as following:
chdir $fold_path
but use qx
call chdir
command of linux doesn't work as following:
qx(chdir $fold_path)
so what is the reason? Not so clear!
Asked
Active
Viewed 346 times
1 Answers
3
There are two reasons:
There's no
chdir
in Linux. It's calledcd
.After you change directory in
qx
, it only affects the child process. It doesn't change the working directory for the parent, i.e. the Perl script that called it.

choroba
- 231,213
- 25
- 204
- 289
-
There *is* a `chdir` in Windows, though. – Jim Davis Dec 05 '14 at 19:17
-
@JimDavis: But the question mentions "`chdir` command of linux". – choroba Dec 05 '14 at 19:59