my $full_file = "$directory/$file"; #### next if $file =~ /^\.{1,2}$/; # or next if $file eq '.' || $file eq '..'; # ...