if ( -f $path ) { print "do something, its a file\n"; }