in reply to checking if file is empty or not
if (-s $filename) { # The file is not empty } [download]