Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

perl6 IO::Handle has no printf method, inconsistent with documentation, or I missed something?

Tags:

file

printf

raku

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 !!

like image 392
lisprogtor Avatar asked Jan 09 '17 08:01

lisprogtor


1 Answers

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.

like image 123
CIAvash Avatar answered Sep 18 '22 13:09

CIAvash