I am trying to open a file for writing and use printf
to do formatting, but documentation and reality do not seem to agree. Am I missing something?
To exit type 'exit' or '^D'
> my $fh=open "test", :w;
IO::Handle<"test".IO>(opened, at octet 0)
> $fh.printf: "test";
No such method 'printf' for invocant of type 'IO::Handle'
in block <unit> at <unknown file> line 1
But my code seems okay according to documentation:
https://docs.perl6.org/routine/printf
Thank you very much !!
Apparently IO::Handle.printf
was added on Nov 27, 2016 and Rakudo 2016.11 is tagged on Nov 19. So my guess is your Rakudo is older than that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With