Documentation for routine get

Documentation for routine get, assembled from the following types:

class IO::Handle

From IO::Handle

(IO::Handle) routine get

Defined as:

method get(IO::Handle:D: --> Str:D)
multi sub 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) if the handle's .chomp attribute is set to True. Returns Nil, if no more input as available. The subroutine form defaults to $*ARGFILES if no handle is given.

    $*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 

class IO::ArgFiles

From IO::ArgFiles

(IO::ArgFiles) method get

Return one line of the open file handle.

class IO::Socket::INET

From IO::Socket::INET

(IO::Socket::INET) method get

method get()

Reads a line from the socket and returns it. Returns the Str type object on end-of-file (EOF).