in reply to chdir in perl

Using the backticks creates a subprocess and executes the shell command chdir (which probably doesn't exist) there, which doesn't change the environment in the process that is running your script

the perl function chdir() works as intended. Check if the path in $mpath really exists and you have the rights to chdir to it

UPDATED three times. Sloppy writing and code reading by me