$x++ if $x%2;

This increments $x if $x is odd.

Shawn




                                                                                       
                                          
                    robert.zielfelder@tycoelect                                        
                                          
                    ronics.com                         To:     [EMAIL PROTECTED]      
                                          
                                                       cc:                             
                                          
                    10/09/2002 10:58 AM                bcc:                            
                                          
                                                       Subject:     Odd and even 
numbers                                         
                                                                                       
                                          




Greetings,

I am trying to write a script that at one point needs to look at a number
and divide it by two.  The results must always be an integer, but the
numerator can potentially be an odd number.  What I want to do is if the
numerator is odd, increment it to the next highest even number.  Is there a
function in PERL that will allow me to test weather or not an integer is
odd
or even so that I can increment the number before I do the division?

Rz


--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]







**********************************************************************
This e-mail and any files transmitted with it may contain 
confidential information and is intended solely for use by 
the individual to whom it is addressed.  If you received
this e-mail in error, please notify the sender, do not 
disclose its contents to others and delete it from your 
system.

**********************************************************************


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to