Perl Programming/Keywords/exit

The exit keyword
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.