... use File::chdir; $CWD = '/usr/bin'; # Oh hey, in /usr/bin/ ... #### ... use File::chdir; $CWD = '/home/me/perl'; # Now in /home/me/perl { local $CWD = '/home/you/python'; # Now in /home/you/python ... } # Back in /home/me/perl ...