IO::Statistics - Transparently perform statistics on IO handles
use IO::Statistics; my ($read, $write) = (0, 0); IO::Statistics->count (\$read, \$write, \*STDOUT); # alternatively: my $ios = IO::Statistics->new (\$read, \$write); $ios->via (\*STDOUT); print "fooo"; print "bkzlfdlkf\n"; END { print "read $read bytes read, wrote $write bytes\n"; }
This module allows you to count IO activity on a file handle transparently.
Using this IO layer on a global filehandle might result in segfault on perl_destruct.
perl_destruct
----------------------------------- ------ ------ ------ ------ ------ ------ File stmt branch cond sub time total ----------------------------------- ------ ------ ------ ------ ------ ------ blib/lib/IO/Statistics.pm 100.0 100.0 n/a 100.0 100.0 100.0 Total 100.0 100.0 n/a 100.0 100.0 100.0 ----------------------------------- ------ ------ ------ ------ ------ ------
Chia-liang Kao <clkao@clkao.org>
Copyright 2004 by Chia-liang Kao <clkao@clkao.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://www.perl.com/perl/misc/Artistic.html
To install IO::Statistics, copy and paste the appropriate command in to your terminal.
cpanm
cpanm IO::Statistics
CPAN shell
perl -MCPAN -e shell install IO::Statistics
For more information on module installation, please visit the detailed CPAN module installation guide.