Perl – Difference between cd and function chdir

cdchdirperl

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

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