I'm confused - you said your later changes (to allow the write to complete) solved the problem, but that doesn't explain at all why Win32::SerialPort acted differently on a restart than a non-Perl application. Where is the state informations saved, or what is Win32::SerialPort looking at that other apps don't?