my $file = "xyz.txt"; unless (open (FILE, "<", $file)) { die "Error: can't open file '$file': $!\n"; }