27 Feb 2014 00:32:20 UTC
- Distribution: Devel-Autoflush
- Module version: 0.06
- Source (raw)
- Browse (raw)
- How to Contribute
- Repository (git clone)
- Issues (1)
- Testers (3053 / 0 / 0)
- KwaliteeBus factor: 1
- % Coverage
- License: apache_2_0
- Perl: v5.6.0
- Activity24 month
- Download (12.61KB)
- MetaCPAN Explorer
- Subscribe to distribution
- This version
- Latest version
- COPYRIGHT AND LICENSE
Devel::Autoflush - Set autoflush from the command line
perl -MDevel::Autoflush Makefile.PL
This module is a hack to set autoflush for STDOUT and STDERR from the command line or from
PERL5OPTfor code that needs it but doesn't have it.
This often happens when prompting:
# guess.pl print "Guess a number: "; my $n = <STDIN>;
As long as the output is going to a terminal, the prompt is flushed when STDIN is read. However, if the output is being piped, the print statement will not automatically be flushed, no prompt will be seen and the program will silently appear to hang while waiting for input. This might happen with 'tee':
$ perl guess.pl | tee capture.out
Use Devel::Autoflush to work around this:
$ perl -MDevel::Autoflush guess.pl | tee capture.out
Or set it in
$ export PERL5OPT=-MDevel::Autoflush $ perl guess.pl | tee capture.out
= SEE ALSO
CPANPLUS::Internals::Utils::Autoflush -- same idea but STDOUT only and
only available as part of the full CPANPLUS distribution
Please report any bugs or feature requests through the issue tracker at https://github.com/dagolden/Devel-Autoflush/issues. You will be notified automatically of any progress on your issue.
This is open source software. The code repository is available for public review and contribution under the terms of the license.
git clone https://github.com/dagolden/Devel-Autoflush.git
David Golden <firstname.lastname@example.org>
This software is Copyright (c) 2014 by David Golden.
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
Module Install Instructions
To install Devel::Autoflush, copy and paste the appropriate command in to your terminal.
perl -MCPAN -e shell install Devel::Autoflush
For more information on module installation, please visit the detailed CPAN module installation guide.