--- Mike Patterson <[EMAIL PROTECTED]> wrote:
> How do I compare if a value it missing?
> I want to use a second date if the first date is missing.
> 
> #Imagine my vars have this data
> $date1="";
> $date2="10/2/1997";
> 
> if ($date1 eq "") {                #do I use "", MISSING key word
> ?????
>     $date1 = $date2;
> }

Try an or:

   $date = $expr1 || $expr2;

If $expr1 is boolean false (0,"",or undef), $date will be set to
$expr2.

You might also use a trinary ?: operator --

  $date = $expr1 ? $expr1 : $expr2;

It really depends on what you're using for $expr's.


__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

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

Reply via email to