sub exit

Documentation for sub exit assembled from the following types:

language documentation Independent routines

From Independent routines

(Independent routines) sub exit

Defined as:

multi sub exit()
multi sub exit(Int(Any$status)

Exits the current process with return code $status or zero if no value has been specified. The exit value ($status), when different from zero, has to be opportunely evaluated from the process that catches it (e.g., a shell); it is the only way to return an exit code different from zero from a Main.

exit prevents the LEAVE phaser to be executed, but it will run the code in the &*EXIT variable.

exit should be used as last resort only to signal the parent process about an exit code different from zero, and not to terminate exceptionally a method or a sub: use exceptions instead.