method printf

Documentation for method printf assembled from the following types:

class IO::Handle

From IO::Handle

(IO::Handle) method printf

Defined as:

multi method printf(IO::Handle:D: Cool $format*@args)

Formats a string based on the given format and arguments and .prints the result into the filehandle. See sub sprintf for details on acceptable format directives.

Attempting to call this method when the handle is in binary mode will result in X::IO::BinaryMode exception being thrown.

my $fh = open 'path/to/file':w;
$fh.printf: "The value is %d\n"32;

class IO::CatHandle

From IO::CatHandle

(IO::CatHandle) method printf

Defined as:

multi method printf(|)

The IO::CatHandle type overrides this method to throw X::NYI exception. If you have a good idea for how this method should behave, tell Rakudo developers about it!