txt: ## orelse.md
  orelse
  
  Combined from primary sources listed below.
  
  # [In Operators](#___top "go to top of document")[§](#(Operators)_infix_orelse "direct link")
  
  See primary documentation
  [in context](/language/operators#infix_orelse)
  for **infix orelse**.
  
  The `orelse` operator is similar to `infix //`, except with looser precedence and `$_` aliasing.
  
  Returns the first defined argument, or else the last argument. Last argument is returned as-is, without being checked for definedness at all. Short-circuits. The result of the left side is bound to `$_` for the right side, or passed as an argument if the right side is a [`Callable`](/type/Callable), whose [count](/routine/count) must be `0` or `1`.
  
  This operator is useful for handling [`Failure`](/type/Failure)s returned by routines since the expected value is usually [defined](/routine/defined) and [`Failure`](/type/Failure) never is:
  
  ```raku
  sub meows { ++$ < 4 ?? fail 'out of meows!' !! '🐱' }
  
  sub meows-processor1 { meows() orelse .return } # return handled Failure
  sub meows-processor2 { meows() orelse fail $_ } # return re-armed Failure
  sub meows-processor3 {
      # Use non-Failure output, or else print a message that stuff's wrong
      meows() andthen .say orelse ‘something's wrong’.say;
  }
  
  say "{.^name}, {.handled}"  # OUTPUT: «Failure, True␤»
      given meows-processor1;
  say "{.^name}, {.handled}"  # OUTPUT: «Failure, False␤»
      given meows-processor2;
  meows-processor3;           # OUTPUT: «something's wrong␤»
  meows-processor3;           # OUTPUT: «🐱␤»
  ```
  