Can anyone tell me why this program won't kick out when the time gets beyond time in the loop?
sub showtime
{
local($format,$military)=@_;
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)=localtime(time);
if \(\(! $military\) && \($hour > 12\)\) \{$hour-=12;\}
$min=sprintf\("%02d",$min\);
$sec=sprintf\("%02d",$sec\);
$format =~ s/SS/$sec/g;
$format =~ s/HH/$hour/g;
$format =~ s/MM/$min/g;
return $format;
}
printf &showtime("The Time is Now HHMM\n",1);
while ($showtime le 2345)
{
while ($x==0 )
{
if (-e $legrun)
{
$x=0;
sleep 10;
}
else
{
$x=1;
}
}
$x=0;