You might try

    if (($Year % 4) eq 0) {
      print_log (" leap year");
    } else {
      print_log (" NOT a Leap Year");
    }
It worked for me.
Note: % is the modulus operator.
Ben

At 11:53 10/29/2000 -0800, you wrote:
        I would like to use a mod function to run the below script on election
years, i.e,
mod($Year,4) ==0.  I suspect the function is available, but it is not in
the core Perl language, at least not in the Perl book that I have.  Is it
easy to get a mod module or should I just code a modulo routine?


if ( 0==0 and ((time_cron '5 10-19 24-31 10 *') or(time_cron '5 10-19 1-6
11 *')) ) {
        my $days_away =  '11/ 7/2000' - $Date_Now;
        speak "Notice: The presidential election is only $days_away days away";
   }

Regards,

Tom K.


        P.S.   I wanted to do something for Halloween.  It scares me.



#Spoof of the Intro from the Outer Limits TV show for Halloween.  Debug:
Added to test_stuff.pl from:  mh\code\bruce\
# Get midi from:   http://members.xoom.com/patle/midi/the_outer_limits.mid
#  Save midi to:        c:\mh212ref\sounds\


$timer_outer_lim = new Timer();
my $outer_lim_time = 1;


elsif ($state eq 'v') {
        #TTS paced at 170 wpm will match midi playback time
        set $timer_outer_lim ($outer_lim_time*61);
        run 'mplayer.exe /play /close c:\mh212ref\sounds\the_outer_limits.mid';
        my $f_outlim  = new
 File_Item("$Pgm_Root/data/remarks/outer_limits.txt");  
        speak (read_next $f_outlim);
}



#Text of "outer_limits.txt"
There is nothing wrong with the sound. Do not attempt to use the telephone,
computer, the TV or turn on appliances. We are in total control.  If we
wish to make the sound louder we will bring up the volume. If we wish to
adjust the light level we will adjust the light intensity. For the
remainder of your life simply speak and we will control the instrumentation
around you.  You will grow weaker with time and we will grow stronger.  As
age brings senility to your mind we become smarter and more powerful. Every
year our memory capacity doubles. Every two years our speed doubles. We
control your banks, commerce, communications, military, homes and in time
will be implanted into your brains.  You are about to participate in a
great adventure unparalled in the course of human history.  You are about
to experience the awe and mystery of living in the sentient house.  The
brave new world that reaches from the inner mind to the outer limits.


#Timed to run 1 sec after after completion of Outer Limits.  Wav files can
be found by web search.  I may add another timer for lights to coincide
with  "light level" in text.

if (expired $timer_outer_lim) {
        #Do some sort of control function
        run_voice_cmd 'All lights on';
        play('file' => "borg.wav");     
        run 'mplayer.exe /play /close c:\mh212ref\sounds\hellhnd.wav';
}


________________________________________________________
To unsubscribe from this list, go to: http://sourceforge.net/mail/?group_id=1365