Next | System Programming in Perl | 19 |
Another thing in the process is the current directory
This is why you can't write a Perl script to change your current directory
plover% pwd /home/mjd
plover% cat do-cd chdir '/tmp'; print "I am now in ", qx{pwd}, "\n";
plover% perl do-cd I am now in /tmp.
plover% pwd /home/mjd
The pwd command in the script thinks the directory changed
But the shell disagrees
Why?
Next | Copyright © 2003 M. J. Dominus |