it is better not to have "\n" at the end of the die message. You get more information from $! without it.
The extra information has nothing to do with $! (see die for details).
BTW, since you (the OP) are using Windows, you may want to include $^E in addition to $! as $^E will sometimes have a more to-the-point explanation, especially in "permission denied" scenarios.
- tye
In reply to Re^3: Permission denied when opening files in Windows ($! $^E)
by tye
in thread Permission denied when opening files in Windows
by jsnicaise
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |