#!/usr/bin/perl -w use strict; $|++; open Fh, "file" or die "file: $!\n"; my $s = -s Fh; my ($last, $total) = 0; while (){ $total += length; my $p = int($total * 100 / $s); if ($p != $last){ $last = $p; print STDERR $p % 10 ? "." : "$p%"; } }