See Original text in context
multi sub 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
.
See Original text in context
method getc(IO::Handle: --> Str)multi sub getc (IO::Handle = --> Str)
Reads a single character from the input stream. Attempting to call this method when the handle is :$enc
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:
See Original text in context
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 :$encoding
, 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»