Hi,
How can I access a specific child process, such that I put all my system commands in one child process?

Thanks alot
Eliyah


Bob Showalter wrote:

Eliyah Kilada wrote:
Hi,
It seems that the following code gives unexpected results:

system ("cd $dir_name");
system ("pwd");
---> this prints the old directory name not the new one. In other
words, the previous (cd) command hasn't taken its effect!
Do anyone know why?

Each call to system() creates a separate process in which the command is
executed. The cd command only affects that separate process.

You need to use Perl's chdir() function to change the working directory for
the current process.



--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to