Die Functions





This function causes Perl to print a message and then stop the program immediately, Actually die is like print: It displays its arguments (which can be a list) so that you are not restricted to displaying a single string. If the last value in the list does not end with a newline character , Perl also prints the name of the program and the line number, followed by a newline character,
($now > ( $a + 6)) or die(" Its bad");
Perl will display something like:
Its bad at test.pl line 10
die and exit functions are often used on the right side of the or operator (11) in logical expression.
Domain Name Search
|