in reply to
Re^2: Low-level version of Win32::API::Struct
in thread Low-level version of Win32::API::Struct
That is not an example from the docs.
my $getCursor = new Win32::API('user32', 'GetCursorPos','S','N');
my $getCursor = new Win32::API('user32', 'GetCursorPos','P','N');
since $lpPoint is a scalar string formally. 'S'/'T' are only for ::Struct objects. The result of pack() is a scalar string. Not a blessed object. If you had a newer version of ::API, you would get a proper croak message
croak("Win32::API::Call: parameter %d must be
+a%s", i+1, " Win32::API::Struct object!\n");
much better than 0.68 blindly doing ->Pack() on whatever scalar happens to fall in as argument which is what is happening in your case.