Print message in case of file open failure
open (FILEHANDLE, ">hello.txt") or die "Cannot open hello.txt"; print FILEHANDLE "Hello!"; close (FILEHANDLE);