Devel::Autoflush(3pm)
β¨ NAME β¨
Devel::Autoflush β bestie, it sets autoflush straight from the command line π
πΈ VERSION πΈ
version 0.06 β yes she's on 0.06, iconic behavior
π¦ SYNOPSIS π¦
perl -MDevel::Autoflush Makefile.PL
like that's it, that's the whole vibe
π DESCRIPTION π
okay so real talk: this module is a hack (the author's word, not mine, and honestly we respect the honesty) that turns on autoflush for STDOUT and STDERR from the command line, or from PERL5OPT, for code that needs it but doesn't have it. no cap.
when does this happen? bestie, it happens when you're prompting someone:
# guess.pl
print "Guess a number: ";
my $n = <STDIN>;
so here's the tea π΅ β as long as the output is going to a terminal, that prompt gets flushed when STDIN is read. cute. fine. normal.
BUT β and this is the part that ruins lives β if the output is being piped, that print statement does not get automatically flushed. so no prompt shows up. and the program just sits there, silently, appearing to hang while it waits for input. it's giving "is it frozen? is it dead? did I break it?" π
this might happen with tee, for example:
$ perl guess.pl | tee capture.out
so you use Devel::Autoflush to work around it, periodt:
$ perl -MDevel::Autoflush guess.pl | tee capture.out
or you can set it in PERL5OPT like the queen you are:
$ export PERL5OPT=-MDevel::Autoflush
$ perl guess.pl | tee capture.out
π SEE ALSO π
CPANPLUS::Internals::Utils::Autoflushβ same idea, honestly same energy, but it'sSTDOUTonly π and it's only available as part of the full CPANPLUS distribution, so you can't just grab it solo
π«Ά SUPPORT π«Ά
π Bugs / Feature Requests π
found a bug? want a feature? please report it through the issue tracker at <https://github.com/dagolden/Devel-Autoflush/issues> π and you'll be notified automatically of any progress on your issue β no wondering, no refreshing, she just tells you
π¦ Source Code π¦
this is open source software, bestie. the code repository is right there for public review and contribution under the terms of the license:
<https://github.com/dagolden/Devel-Autoflush>
git clone https://github.com/dagolden/Devel-Autoflush.git
π AUTHOR π
David Golden <dagolden@cpan.org> β the main character, fr fr
β COPYRIGHT AND LICENSE β
This software is Copyright (c) 2014 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
and that's the whole page, bestie! written for perl v5.36.0, dated 2022-10-13 π go forth and stop your prompts from ghosting you πβ¨
π¦ where this page comes from
- ubuntu noble: libdevel-autoflush-perl 0.06-3 Β· Apache-2.0
- ubuntu resolute: libdevel-autoflush-perl 0.06-3 Β· Apache-2.0
- ubuntu stonking: libdevel-autoflush-perl 0.06-3 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms