iDev iDev - 5 months ago 49
Perl Question

Difference between cd and function chdir

What is the difference between the

cd
shell command and the Perl function
chdir
? Please can you explain with an example?

Answer

The cd command changes the current directory of a shell process; the Perl chdir function changes the current directory of a Perl process. They're exactly the same thing, just spelled differently.

Comments