http://www.perlmonks.org?node_id=651897


in reply to Traversing directories recursively

By choosing a different regex delimiter and using a ? (0 or 1) quantifier you can make this line

next if ( "$dir_name/$file" =~ /\/\.$/ or "$dir_name/$file" =~ /\/\.\. +$/ );

simpler and more readable

next if "$dir_name/$file" =~ m{/\.\.?$};

Cheers,

JohnGG