Jump to content

Perl Programming/Keywords/exit

From Wikibooks, open books for an open world
Previous: exists Keywords Next: exp

The exit keyword

[edit | edit source]

exit finishes the execution of the program after valuating EXPRESSION. It returns with this value.

Although exists can be called on arrays also, its behaviour strongly depends to the use of delete on arrays, having a much less clear behaviour.

Syntax

[edit | edit source]
  exit EXPRESSION
  exit

Examples

[edit | edit source]
print "Exists\n"    if exists $hash{$key};
print "Defined\n"   if defined $hash{$key};
print "True\n"      if $hash{$key};

See also

[edit | edit source]
Previous: exists Keywords Next: exp