in reply to Rename old files that do not begin with a dot

if (-f && '$_, !~ /^\./' && ($age > $limit)) { ^^^^^^^^^^^^^^

What's with the quotes? This is just a string literal. You might as well have written

if (-f && 'Hello World' && ($age > $limit)) {

Fix:

if (-f && $_ !~ /^\./ && ($age > $limit)) {

Or just

if (-f && !/^\./ && ($age > $limit)) {

Please wrap you code in <c>...</c> tags in the future.