Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: master
Fetching contributors…

Cannot retrieve contributors at this time

executable file 25 lines (19 sloc) 0.538 kb
#!/usr/bin/perl -w
use strict;
$| = 1; # autoflush on
die "Usage: $0 <action> <number-of-lines>\n"
unless @ARGV == 2;
my $action = shift;
my $number_of_lines = shift;
my $TOTAL_LINE_LENGTH = 78;
my $dots_length = $TOTAL_LINE_LENGTH - length($action) - 8;
print $action;
my $dots_so_far = 0;
for my $current_line (1..$number_of_lines) {
my $line = <>;
while ( $dots_so_far < int($current_line/$number_of_lines*$dots_length) ) {
print '.';
$dots_so_far++;
}
}
print '.' x ($dots_length - $dots_so_far);
Jump to Line
Something went wrong with that request. Please try again.