Need to have || die "Could not open file" 
Other option is to add 
use autodie;
http://search.cpan.org/~pjf/autodie/lib/autodie.pm