The close routine

Combined from primary sources listed below.

In class IO::Pipe ( Type/IO/Pipe )§

See primary docmentation in context for method close.

method close§

method close(IO::Pipe: --> Proc:D)

Closes the pipe and returns Proc object from which the pipe originates.

In role IO::Socket ( Type/IO/Socket )§

See primary docmentation in context for method close.

method close§

method close(IO::Socket:D)

Closes the socket.

Fails if the socket is not connected.

In class IO::CatHandle ( Type/IO/CatHandle )§

See primary docmentation in context for method close.

method close§

method close(IO::CatHandle:D: --> True)

Closes the currently active source handle, as well as any already-open source handles, and empties the source handle queue. Unlike a regular IO::Handle, an explicit call to .close is often not necessary on an IO::CatHandle, as merely exhausting all the input closes all the handles that need to be closed.

with IO::CatHandle.new: @bunch-of-handles {
    say .readchars: 42;
    .close# we are done; close all the open handles
}