How can I automatically clean a Perl 6 file?

There are several answers for Perl 6 in the days of Parrot, and they don't seem to work at the moment:

This is the version of Rakudo 2017.04.3, built on the MoarVM version 2017.04-53-g66c6dda implementation of Perl 6.c.

Reply to Does perl6 include "autoflush" by default? says it is enabled by default (but it was 2011).

Here is the program I played with:

$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";

And its conclusion, which is a bad order:

2. This is standard out
1. This is an error

So maybe I need to turn it on. There How can I turn off autoflush? which mentions the method autoflush:

$*ERR.autoflush = True;
$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";

But this does not work:

There is no such "autoflush" method for invocant like "IO :: Handle"

, , -, . , , Perl 6 .

, Perl 6 , , ? Perl 5 , ?

+4
4

, , , :

$*ERR.out-buffer = False;
$*ERR.say: "1. This is an error";
$*OUT.say: "2. This is standard out";

, .

Rakudo Star 2017.10.

+2

. rakudo , (2017.06-173-ga209082 built on MoarVM version 2017.06-48-g4bc916e)

:buffer io , ( :!buffer), .

, isatty .

+5

Rakudo (). $OUTPUT_AUTOFLUSH 5to6-perlvar.

raiph # perl6 IRC log search, , autoflush, , , ( flush), , .

+3

STDOUT STDERR, , ( ):

$*OUT = $*OUT.open(:!buffer);
$*ERR = $*ERR.open(:!buffer);

, , . API, .

0

Source: https://habr.com/ru/post/1681020/


All Articles