Difference between cd and function chdir

iDev picture iDev · Aug 21, 2012 · Viewed 8k times · Source

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

Answer

Alan Curry picture Alan Curry · Aug 21, 2012

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.