In IO::Socket::INET§
See primary documentation in context for method get
method get()
Reads a line from the socket and returns it as of type Str
. Return Nil
on end-of-file (EOF).
In IO::Handle§
See primary documentation in context for routine get
method get(IO::Handle: --> Str)multi get (IO::Handle = --> Str)
Reads a single line of input from the handle, removing the trailing newline characters (as set by .nl-in
) if the handle's .chomp
attribute is set to True
. Returns Nil
, if no more input is available. The subroutine form defaults to $*ARGFILES
if no handle is given.
Attempting to call this method when the handle is in binary mode will result in X::IO::BinaryMode
exception being thrown.
.get.say; # Read one line from the standard inputmy = open 'filename';.get.say; # Read one line from a file.close;say get; # Read one line from $*ARGFILES
In role IO::Socket§
See primary documentation in context for routine get
method get(IO::Socket: --> Str)
Reads a single line of input from the socket, removing the trailing newline characters (as set by .nl-in
). Returns Nil
, if no more input is available.
Fails if the socket is not connected.
In Independent routines§
See primary documentation in context for sub get
multi get (IO::Handle = )
This routine is a wrapper for the method of the same name in IO::Handle
. If no Handle
is specified, defaults to $*ARGFILES
.
In IO::CatHandle§
See primary documentation in context for method get
method get(IO::CatHandle: --> Bool)
Returns a single line of input from the handle, with the new line string defined by the value(s) of $.nl-in
attribute, which will be removed from the line if $.chomp
attribute is set to True
. Returns Nil
when there is no more input. It is an error to call this method when the handle is in binary mode, resulting in X::IO::BinaryMode
exception being thrown.
(my = 'foo'.IO).spurt: "a\nb\nc";(my = 'bar'.IO).spurt: "d\ne";my = IO::CatHandle.new: , ;.say while = .get; # OUTPUT: «abcde»