Search code examples
perlcdchdir

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?


Solution

  • 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.