Use three argument open, let perl tell you why this failed, $!.
In reply to Re: Failed to clode file by marto in thread Failed to close file by ovedpo15