in reply to Re: Using $! and passing errors
in thread Using $! and passing errors

However this does NOT mean $! is readonly, you can change it. If you want it to be meaningful, set it to a number outside the range that being used by system. Again, there is a big chance that, at the time you check its value, it has been reset by the system, so you don't get what you want.