Girish Venkatachalam


Progress::PV Use the pipe viewer command from inside perl to add progress bar to tar extraction, decompression,checksumming and so on


pv gives you the ability to see the progress of operations that take time. But this will not always work. Only when a single file is processed you can view the progress. pv works as a pass through copying STDIN to STDOUT thereby adding progress bar based on the rate of processing STDOUT.

If no display switches are specified, pv behaves as if -p, -t, -e, -r, and -b had been given (i.e. everything except average rate is switched on). Otherwise, only those display types that are explicitly switched on will be shown.

 From the pv man page:

        pv allows a user to see the progress of data through a pipeline, by
       giving information such as time elapsed, percentage completed
        (with progress bar), current throughput rate, total data transferred,
        and ETA.

       To use it, insert it in a pipeline between two processes, with the
       appropriate options.  Its standard input will be passed through to its
       standard output and progress will be shown on standard error.

       pv will copy each supplied FILE in turn to standard output 
       (- means standard input), or if no FILEs are specified just standard
       input is copied. This is the same behaviour as cat(1).

       A simple example to watch how quickly a file is transferred using

              pv file | pv -w 1 3000


use Progress::PV;

my $pv = Progress::PV->new('/usr/local/bin/pv');

$pv->{options} = ...


croak $pv->errstr unless $result;

        All options in pv

                progress        => '-p',
                etatimer        => '-e',
                ratecnter       => '-r',
                avgrate         => '-a',
                bytecnter       => '-b',
                timeron         => '-t',
                numericop       => '-n',
                quietmode       => '-q',
                waitmode        => '-W',
                forceop         => '-f',
                cursorpos       => '-c',
                linemode        => '-l',
                help            => '-h',
                version         => '-V',

                assumesize      => '-s SIZE',
                termwidth       => '-w WIDTH',
                termheight      => '-h HEIGHT',
                nameprefix      => '-N NAME',
                ratelimit       => '-L RATE',
                bufsize         => '-B BYTES',
                inputfiles      => '-file files... (shell globbed)',
                cmd     => '-cmd command to run in pipe'



        For instance,

        use PV;
        $pv = Progress::PV->new();
        $pv->{options} = {'-file' => '/home/foo/chatserver.img', '-cmd' => 'sha1'};



        Contructs Progress::PV object.It takes a path of pv command.
        You can omit this argument and this module searches pv command within PATH environment variable.

options{ @options }

        Specify pv command options directly 


        Executes pv command with specified options.


An alias of showprogress()


        Get pv command output to stdout.


        Get pv command output to stderr.

        Specify output file name and output options.

        Avaiable options are:
        The destination IP address to connect to or in case of UNIX
domain sockets the destination socket file to connect to
        The port to connect to
        Set the author.
        Set the comment.


        Girish Venkatachalam, <girish at>


        Please report any bugs or feature requests to
        C<bug-text-cowsay at>, or through the web interface at
        I will be notified, and then you'll automatically be notified of progress on
        your bug as I make changes.


        You can find documentation for this module with the perldoc command.

        perldoc Progress::PV

        You can also look for information at:
  • AnnoCPAN: Annotated CPAN documentation

  • CPAN Ratings

  • RT: CPAN's request tracker

  • Search CPAN



Andrew Wood<> is the author of pv.


        Copyright 2012 Girish Venkatachalam, all rights reserved.

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