opendir my $dh, $dir or "Can not open directory $dir: $!";