Following up from here: Perl Imgsize not working in loop? I have another question - how do I not let perl list the single and double dot entries when it reads the files in a dir
To test string you have to use eq:
eq
if($file eq "." || $file eq ".."){ next;}
or:
next if $file =~ /^\.\.?$/;