if (-e $log) { open .... do lots of stuff... } else { do lots of other stuff }