Devel::Autoflush - Set autoflush from the command line


Devel-Autoflush documentation  | view source Contained in the Devel-Autoflush distribution.

Index


NAME

Top

Devel::Autoflush - Set autoflush from the command line

VERSION

Top

This documentation describes version 0.05.

SYNOPSIS

Top

  perl -MDevel::Autoflush Makefile.PL

DESCRIPTION

Top

This module is a hack to set autoflush for STDOUT and STDERR from the command line or from PERL5OPT for 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 PERL5OPT:

   $ export PERL5OPT=-MDevel::Autoflush
   $ perl guess.pl | tee capture.out

BUGS

Top

Please report any bugs or feature using the CPAN Request Tracker. Bugs can be submitted through the web interface at http://rt.cpan.org/Dist/Display.html?Queue=Devel-Autoflush

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.

SEE ALSO

Top

AUTHOR

Top

David A. Golden (DAGOLDEN)

COPYRIGHT AND LICENSE

Top


Devel-Autoflush documentation  | view source Contained in the Devel-Autoflush distribution.