Online Learning Applications for Technical English


Home
Syllabus
Assignments

Instructor



Producing Homepages

We can use the die function to print an error message and end the program. For example,
  if( !open( DATA_FILE, "< $DATA_FILENAME" ) )
  {
    die "Cannot open data file $DATA_FILENAME: $!";
  }
Note 1: The $! variable is a special Perl variable for trapping error messages from the system right after a failed system request.

[ Back ]