#!/usr/bin/perl # # display stuff on systemclock use Switch; # Get current date & time my ($tsec,$tmin,$thour,$tday,$tmonth,$tyear,$twday,$tyday,$tisdst) = localtime(time); $showitems=10; $delay=5; $totalshowtime=$showitems*$delay; #calulate how many minutes it will take to complete $showminutes = $totalshowtime / 60; #remove everthing behind the . so we get a round number $showminutes =~ s/(\d)\.\d*/$1/; switch ($showminutes) { case /0/ { my $number= $tsec / ($showitems * $delay) ; print "$number\n"; #print "0\n"; } case /1/ {print "1\n"; } else {print "-$showminutes- did not match any\n";} } print "$showminutes | $totalshowtime = $showitems * $delay"; print "\n$tsec $tmin";