my $current_directory = getcwd(); try { chdir($working_directory); } finally { chdir($current_directory); };