rakudo-star

perl6/rakudo: How could I disable autoflush?

对着背影说爱祢 提交于 2020-01-03 17:15:30
问题 I tried this, but it didn't work: $*OUT.autoflush( 0 ); 回答1: $*OUT.autoflush = False should disable it, and it runs without error, but it seems that parrot's IO still flushes automatically. So there currently doesn't seem to be an easy way. 回答2: Rakudo doesn't support autoflush. There's a note in 5to6-perlvar under the $OUTPUT_AUTOFLUSH entry. Some examples from a long time ago mention an autoflush method, but that has disappeared: $*ERR.autoflush = True; $*ERR.say: "1. This is an error"; $

perl6/rakudo: Does perl6 enable “autoflush” by default?

放肆的年华 提交于 2020-01-03 15:59:39
问题 #!perl6 use v6; my $message = "\nHello!\n\nSleep\nTest\n\n"; my @a = $message.split( '' ); for @a { sleep 0.3; .print; } Does perl6 enable "autoflush" by default. With perl5 without enabling "outflush" I don't get this behavior. 回答1: Rakudo enables autoflush by default; the specification is silent about the default. 回答2: Quoting from the docs regarding auto flush: ‘No global alternative available. TTY handles are unbuffered by default, for others, set out-buffer to zero or use :!out-buffer