First of all you should make sure that your die message contains the output of $!, the operating system error will often greatly simplify debugging.
Secondly I suggest putting the name of the file into a variable and using that variable in both the open and the die. The reason is that otherwise it is far too easy for someone to come along and change what file is being opened but not edit the error check. That can be a real pain to debug. When you can, you want to reduce the need to synchronize code...
In reply to Re (tilly) 2: -z file test operator
by tilly
in thread -z file test operator
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |