#!/usr/bin/perl use strict; my $directory = './mydirectory'; chdir($directory) || die "Fail to change directory: $!\n";