in reply to can't open a file?

It's not unlike the call to open failed, but your script failed to notice and act accordingly e.g. by dieing.

Try, at line 2, inserting

use warnings; use strict; use autodie;
. These 3 lines will have the effect of

A user level that continues to overstate my experience :-))