in reply to printing a running count
Hi,
update: it's modulus and not modules!
I recommend the modulus trick of course, but, just to prove TIMTOWTDI:
#!/usr/bin/perl use strict; use warnings; my $counter = 1; for my $i (1..20) { # do something with your file, p.e. print $i . " "; ++$counter; if ($counter > 5) { print "."; $counter = 1; } }
So for twenty lines we print four dots (each fifth line).
|
|---|