for(@attchfiles){ if ( -e lc ) { # do something appropriate! } else { rename $_,lc; } }