The die function exits the Perl script and prints out an error message to STDERR : die « System Functions « Perl






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\"";

   
    
    
    
  








Related examples in the same category

1.Using function 'die' to terminate a program
2.Using die to ouput error message