#!perl -w use strict; my $count = 0; my $times = 0; my $sec = 0; print "Doing something "; while (1) { my $time = localtime(); my @broken = split(/ /, $time); for (@broken) { $time = $1 if (/((\d+)\:(\d+)\:(\d+))/); } my @stime = split(/\:/, $time); if ($sec < $stime[2]) { $count++; print "Incremented count!\n"; } $sec = $stime[2]; if ($count == 5) { print ". "; $count = 0; $times++; } last if ($times == 12); } print " done!\n";