in reply to Bad File Descriptor Error
On MSWin32 you might more milage out of using the Win32 functions:
use Win32; Win32::FormatMessage( Win32::GetLastError() ); [download]
instead of relying on $!