Help for this page
chdir $the_directory or die "Couldn't chdir to $the_directory: $!"; opendir(D, ".") ... # other logic later... } closedir D;
chdir $the_directory or die "Couldn't chdir to $the_directory: $!"; opendir(D, ".") ... { # whatever... }