if ($name =~ /^[KS]\d{2}$expression$/) { rename "/etc/$i.d/$name", "/etc/$i.d/.NO.$name" or print "/etc/$i.d/$name not found\n"; }