if( -f $path ){ unlink $path } perldoc -f unlink unlink LIST unlink Deletes a list of files. ... perldoc -f -f ... -f File is a plain file.