The die function exits the Perl script and prints out an error message to STDERR
#!/usr/bin/perl -w $filename = "nofile"; open(TMP, $filename) or die "Can't open \"$filename\"";