opendir local(*DIR), $dir or die "Unable to open $dir: $!"; # or # opendir my $dh, $dir or die "Unable to open $dir: $!";