in reply to bsd_glob does not reset $!

I can't see the error you are getting, but, from perlvar $!: "A successful system or library call does not set the variable to zero."
This is consistent with C system calls.