exit

Synopsis

exit(["reason"])

Causes the currently executing script to stop executing.

Parameters

"reason" - an optional parameter, when a reason is specified, this will be printed as a runtime warning.

Side Effects / Notes

Examples

debug(15); # 15 is for trace... sub fact { if ($1 == 0) { exit("I just feel like it!"); } return $1 * fact($1 - 1); } fact(2);

Trace: &exit('I just feel like it!') - FAILED! at exit.sl:5 Warning: I just feel like it! at exit.sl:5 Trace: &fact(0) - FAILED! at exit.sl:7 Trace: &fact(1) - FAILED! at exit.sl:7 Trace: &fact(2) - FAILED! at exit.sl:10