my $pb = Term::ProgressBar::IO->new($fh);
while (<$fh>) {
+ # do something
$pb->update();
}
Displays a progress bar using L<Term::ProgressBar> which corresponds
to reading from a filehandle.
+This module inherits from L<Term::ProgressBar> and has all of its
+options.
+
=head1 BUGS
None known.
$DEBUG = 0 unless defined $DEBUG;
}
+=head1 METHODS
+
+=head2 new
+
+Create and return a new Term::ProgressBar::IO instance.
+
+=over
+
+=item ARGUMENTS
+
+=over
+
+=item count
+
+A valid filehandle or item count. L<IO::Uncompress> filehandles are
+also properly handled.
+
+=item OTHER ARGUMENTS
+
+All other arguments are documented in L<Term::ProgressBar>
+
+=back
+
+=back
+
+=cut
+
sub init {
my $self = shift;
my $count;
$self->SUPER::init(\%config);
}
+=head2 update
+
+Automatically update the progress bar based on the position of the
+filehandle given at construction time.
+
+=over
+
+=item ARGUMENTS
+
+=over
+
+=item so_far
+
+Current progress point; this defaults to the current position of the
+filehandle. [You probably don't actually want to ever give this.]
+
+=back
+
+=back
+
+=cut
+
sub update {
my $self = shift;
my $count = $self->__determine_count();