in reply to SetACL problems

Not sure where Perl comes into this, which Perl interface are you using? There are several and these will affect the answer.
There are also several layers of Win32 security APISs, and that depend on the version of Windows (NT4, 2000, XP, 2003, Vista all instoduced new security APIs).

Here is what I would do using C/C++/XS:
You can get an existing ACL using GetNamedSecurityInfo(), and then create ACEs with BuildExplicitAccessWithName(). You then merge the new ACEs with the 'old' ACL to create a new one, using SetEntriesInAcl() - I guess this is the guy you want.
You then set the new ACL into the object's security descriptor(SD) using SetNamedSecurityInfo().

I'm not sure what you have screwed up, maybe you wrote a bad SD? The DACL is not supposed to be searched if you are the owner, but it looks like the SID might be toast. If this is a file, try copying it to a non-secure filesystem (like FAT) and back again, always assuming you can get the copy to work. You might have to use an Administrator user for that.

update: OK, I missed that you are using cygwin.