In Independent routines§
See primary documentation in context for sub getc
multi getc (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 getc
method getc(IO::CatHandle: --> Bool)
Returns a single character of input from the handle. All the caveats described in IO::Handle.getc
apply. 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: 'I ♥ Raku';(my = 'bar'.IO).spurt: 'meow';my = IO::CatHandle.new: , ;.say while = .getc; # OUTPUT: «I ♥ Rakumeow»
In IO::Handle§
See primary documentation in context for routine getc
method getc(IO::Handle: --> Str)multi getc (IO::Handle = --> Str)
Reads a single character from the input stream. Attempting to call this method when the handle is in binary mode will result in X::IO::BinaryMode
exception being thrown. The subroutine form defaults to $*ARGFILES
if no handle is given. Returns Nil
, if no more input is available, otherwise operation will block, waiting for at least one character to be available; these caveats apply: