in reply to or warn question
Since you want to log a message regardless, with only the content of the message determined conditionally, the ternary seems ideal suited:
print LOG $ftp->delete($file) ? "$file successfully deleted\n" : "Cannot delete $file - " . $ftp->message;
|
|---|