txt: ## print.md
  print
  
  Combined from primary sources listed below.
  
  # [In IO::Socket::Async](#___top "go to top of document")[§](#(IO::Socket::Async)_method_print "direct link")
  
  See primary documentation
  [in context](/type/IO/Socket/Async#method_print)
  for **method print**.
  
  ```raku
  method print(IO::Socket::Async:D: Str $str --> Promise)
  ```
  
  Attempt to send `$str` on the `IO::Socket::Async` that will have been obtained indirectly via `connect` or `listen`, returning a [`Promise`](/type/Promise) that will be kept with the number of bytes sent or broken if there was an error sending.
  
  # [In IO::Handle](#___top "go to top of document")[§](#(IO::Handle)_method_print "direct link")
  
  See primary documentation
  [in context](/type/IO/Handle#method_print)
  for **method print**.
  
  ```raku
  multi method print(**@text --> True)
  multi method print(Junction:D --> True)
  ```
  
  Writes the given `@text` to the handle, coercing any non-[`Str`](/type/Str) objects to [`Str`](/type/Str) by calling [`.Str`](/routine/Str) method on them. [`Junction`](/type/Junction) arguments [autothread](/language/glossary#Autothreading) and the order of printed strings is not guaranteed. See [write](/routine/write) to write bytes.
  
  Attempting to call this method when the handle is [in binary mode](/type/IO/Handle#method_encoding) will result in [`X::IO::BinaryMode`](/type/X/IO/BinaryMode) exception being thrown.
  
  ```raku
  my $fh = 'path/to/file'.IO.open: :w;
  $fh.print: 'some text';
  $fh.close;
  
  ```
  
  # [In role IO::Socket](#___top "go to top of document")[§](#(role_IO::Socket)_method_print "direct link")
  
  See primary documentation
  [in context](/type/IO/Socket#method_print)
  for **method print**.
  
  ```raku
  method print(IO::Socket:D: Str(Cool) $string)
  ```
  
  Writes the supplied string to the socket, thus sending it to other end of the connection. The binary version is [method write](#method_write).
  
  Fails if the socket is not connected.
  
  # [In Proc::Async](#___top "go to top of document")[§](#(Proc::Async)_method_print "direct link")
  
  See primary documentation
  [in context](/type/Proc/Async#method_print)
  for **method print**.
  
  ```raku
  method print(Proc::Async:D: Str() $str, :$scheduler = $*SCHEDULER)
  ```
  
  Write the text data in `$str` to the standard input stream of the external program, encoding it as UTF-8.
  
  Returns a [`Promise`](/type/Promise) that will be kept once the data has fully landed in the input buffer of the external program.
  
  The `Proc::Async` object must be created for writing (with `Proc::Async.new(:w, $path, @args)`). Otherwise an [`X::Proc::Async::OpenForWriting`](/type/X/Proc/Async/OpenForWriting) exception will the thrown.
  
  `start` must have been called before calling method print, otherwise an [`X::Proc::Async::MustBeStarted`](/type/X/Proc/Async/MustBeStarted) exception is thrown.
  
  # [In Mu](#___top "go to top of document")[§](#(Mu)_method_print "direct link")
  
  See primary documentation
  [in context](/type/Mu#method_print)
  for **method print**.
  
  ```raku
  multi method print(--> Bool:D)
  ```
  
  Prints value to `$*OUT` after stringification using `.Str` method without adding a newline at end.
  
  ```raku
  "abc\n".print;          # OUTPUT: «abc␤»
  ```
  
  # [In Independent routines](#___top "go to top of document")[§](#(Independent_routines)_sub_print "direct link")
  
  See primary documentation
  [in context](/type/independent-routines#sub_print)
  for **sub print**.
  
  ```raku
  multi print(**@args --> True)
  multi print(Junction:D --> True)
  ```
  
  Prints the given text on standard output (the [`$*OUT`](/language/variables#index-entry-%24%2AOUT) filehandle), coercing non-[`Str`](/type/Str) objects to [`Str`](/type/Str) by calling [`.Str` method](/routine/Str). [`Junction`](/type/Junction) arguments [autothread](/language/glossary#Autothreading) and the order of printed strings is not guaranteed.
  
  ```raku
  print "Hi there!\n";       # OUTPUT: «Hi there!␤»
  print "Hi there!";         # OUTPUT: «Hi there!»
  print [1, 2, 3];           # OUTPUT: «1 2 3»
  print "Hello" | "Goodbye"; # OUTPUT: «HelloGoodbye»
  ```
  
  To print text and include the trailing newline, use [`put`](/type/independent-routines#sub_put).
  