in reply to (tye)Re: Win32 equivalant to Errno 'EWOULDBLOCK'
in thread Win32 equivalant to Errno 'EWOULDBLOCK'

It seems from Microsoft's documents, the easiest way to get the error code is to use win32::GetLastError().
  • Comment on Re: (tye)Re: Win32 equivalant to Errno 'EWOULDBLOCK'

Replies are listed 'Best First'.
(tye)Re2: Win32 equivalant to Errno 'EWOULDBLOCK'
by tye (Sage) on Jul 20, 2001 at 09:53 UTC

    Oh, that isn't the problem at all. You can already get the error code via 0+$! (and probably via 0+$^E). But you can't get a description for the error; not with the standard method used for $! [C's strerror()] nor with the standard method used for $^E/GetLastError() [Win32::FormatMessage()] nor with any subroutine that I've found. They don't even have error descriptions in the comments in WinSock.h.

    So my plan was to write error descriptions and put them into a module and patch Perl such that $! would know where to find these descriptioins when its regular method failed. And that looks easier to you than using $! or $^E? Getting the error code isn't the hard part.

            - tye (but my friends call me "Tye")