Wire64 has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl # # display stuff on systemclock use Switch; # Get current date & time my ($tsec,$tmin,$thour,$tday,$tmonth,$tyear,$twday,$tyday,$tisdst) = l +ocaltime(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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: display stuff based on systemclock
by ikegami (Patriarch) on Jul 09, 2009 at 15:55 UTC | |
by Wire64 (Initiate) on Jul 09, 2009 at 16:05 UTC | |
by ikegami (Patriarch) on Jul 09, 2009 at 16:15 UTC | |
|
Re: display stuff based on systemclock
by ramlight (Friar) on Jul 09, 2009 at 17:49 UTC | |
by ikegami (Patriarch) on Jul 09, 2009 at 18:23 UTC | |
by ramlight (Friar) on Jul 09, 2009 at 19:19 UTC | |
by Wire64 (Initiate) on Jul 09, 2009 at 22:07 UTC |