txt: ## exit.md
  exit
  
  Combined from primary sources listed below.
  
  # [In Independent routines](#___top "go to top of document")[§](#(Independent_routines)_sub_exit "direct link")
  
  See primary documentation
  [in context](/type/independent-routines#sub_exit)
  for **sub exit**.
  
  ```raku
  multi exit()
  multi 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](/routine/MAIN).
  
  `exit` prevents the [LEAVE](/language/phasers#LEAVE) phaser to be executed, but it will run the code in the [`&*EXIT`](/language/variables#index-entry-%26*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](/language/exceptions) instead.
  
  The first call of `exit` in a process sets the return code, regardless of any subsequent calls to `exit` in the same, or any other thread.
  