txt: ## get.md
  get
  
  Combined from primary sources listed below.
  
  # [In Independent routines](#___top "go to top of document")[§](#(Independent_routines)_sub_get "direct link")
  
  See primary documentation
  [in context](/type/independent-routines#sub_get)
  for **sub get**.
  
  ```raku
  multi get  (IO::Handle:D $fh = $*ARGFILES) { $fh.get  }
  ```
  
  This routine is a wrapper for the [method of the same name in `IO::Handle`](/type/IO/Handle#routine_get). If no `Handle` is specified, defaults to [`$*ARGFILES`](/language/variables#$*ARGFILES).
  
  # [In IO::Socket::INET](#___top "go to top of document")[§](#(IO::Socket::INET)_method_get "direct link")
  
  See primary documentation
  [in context](/type/IO/Socket/INET#method_get)
  for **method get**.
  
  ```raku
  method get()
  ```
  
  Reads a line from the socket and returns it as of type [`Str`](/type/Str). Return [`Nil`](/type/Nil) on end-of-file (EOF).
  
  # [In IO::Handle](#___top "go to top of document")[§](#(IO::Handle)_routine_get "direct link")
  
  See primary documentation
  [in context](/type/IO/Handle#routine_get)
  for **routine get**.
  
  ```raku
  method get(IO::Handle:D: --> Str:D)
  multi  get (IO::Handle $fh = $*ARGFILES --> Str:D)
  ```
  
  Reads a single line of input from the handle, removing the trailing newline characters (as set by [`.nl-in`](/routine/nl-in)) if the handle's `.chomp` attribute is set to `True`. Returns [`Nil`](/type/Nil), if no more input is available. The subroutine form defaults to [`$*ARGFILES`](/language/variables#index-entry-%24%2AARGFILES) if no handle is given.
  
  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
  $*IN.get.say;              # Read one line from the standard input
  
  my $fh = open 'filename';
  $fh.get.say;               # Read one line from a file
  $fh.close;
  
  say get;                   # Read one line from $*ARGFILES
  
  ```
  
  # [In role IO::Socket](#___top "go to top of document")[§](#(role_IO::Socket)_routine_get "direct link")
  
  See primary documentation
  [in context](/type/IO/Socket#routine_get)
  for **routine get**.
  
  ```raku
  method get(IO::Socket:D: --> Str:D)
  ```
  
  Reads a single line of input from the socket, removing the trailing newline characters (as set by [`.nl-in`](/routine/nl-in)). Returns [`Nil`](/type/Nil), if no more input is available.
  
  Fails if the socket is not connected.
  
  # [In IO::CatHandle](#___top "go to top of document")[§](#(IO::CatHandle)_method_get "direct link")
  
  See primary documentation
  [in context](/type/IO/CatHandle#method_get)
  for **method get**.
  
  ```raku
  method get(IO::CatHandle:D: --> Bool:D)
  ```
  
  Returns a single line of input from the handle, with the new line string defined by the value(s) of [`$.nl-in` attribute](/type/IO/CatHandle#method_nl-in), which will be removed from the line if [`$.chomp` attribute](/type/IO/CatHandle#method_chomp) is set to `True`. Returns [`Nil`](/type/Nil) when there is no more input. It is an error to call this method when the handle is [in binary mode](/type/IO/CatHandle#method_encoding), resulting in [`X::IO::BinaryMode`](/type/X/IO/BinaryMode) exception being thrown.
  
  ```raku
  (my $f1 = 'foo'.IO).spurt: "a\nb\nc";
  (my $f2 = 'bar'.IO).spurt: "d\ne";
  my $cat = IO::CatHandle.new: $f1, $f2;
  .say while $_ = $cat.get; # OUTPUT: «a␤b␤c␤d␤e␤»
  
  ```
  