The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

ProgressMonitor::Stringify::ToStream - a monitor implementation that prints stringified feedback to a stream.

SYNOPSIS

  ...
  # call someTask and give it a monitor that prints to stdout
  #
  someTask(ProgressMonitor::Stringify::ToStream->new({fields => [ ... ]}));

DESCRIPTION

This is a concrete implementation of a ProgressMonitor. It will send the stringified feedback to a stream and backspace to continously overwrite. Optionally, it will clear the feedback entirely, leaving the cursor where it was.

Note that this is probably most useful to send to either stdout/stderr. Sending to a basic disk file probably won't many people happy...See ToCallback if you want to be more clever.

Also, this assumes that backspacing will work correctly which may not be true if the width is so large that the terminal window starts on a new line. Use the inherited configuration 'maxWidth' to limit the width if you have the necessary information.

Inherits from ProgressMonitor::Stringify::AbstractMonitor.

METHODS

new( $hashRef )

Configuration data:

stream (default => \*STDOUT)

This is the stream to write to. Defaults to '\*STDOUT'.

The stream must be able to handle backspacing in order to properly show the fields. Unless the maxWidth is explicitly set, it will be set by checking the stream using Term::Size(::<platform>).

atEndStrategy (default => 'newline')
wipe

The rendered data will be cleared on completion, cursor at the point where it started.

newline

The rendered data will be left, a newline positions the cursor on next line.

none

The rendered data will be left, the cursor remains at the end.

AUTHOR

Kenneth Olwing, <knth at cpan.org>

BUGS

I wouldn't be surprised! If you can come up with a minimal test that shows the problem I might be able to take a look. Even better, send me a patch.

Please report any bugs or feature requests to bug-progressmonitor at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=ProgressMonitor. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find general documentation for this module with the perldoc command:

    perldoc ProgressMonitor

ACKNOWLEDGEMENTS

Thanks to my family. I'm deeply grateful for you!

COPYRIGHT & LICENSE

Copyright 2006,2007 Kenneth Olwing, all rights reserved.

This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.