$i = 'C:/test/hello.exe' ; if ( -f $i) { print "$i is a file !"; push(@filesInDir,$i); } else {print "$i isn't a file !\n"; } }