system is executing the cd command in a forked process and returns to your Perl script. As it's happening in a different process, the working directory of your script doesn't change.
Instead of the system call, use chdir:
chdir '/home/sa/temp';
update -- add links to docs
update the second... i'm guessing the downvote was because of my erroneous description of what system was doing (as eff_i_g explains better). Fixed description to better reflect that. That'll teach me to read the docs better.
In reply to Re: How to change path
by meraxes
in thread How to change path
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |