And, 0 is either '' -or- 0 ;)

-----Original Message-----
From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 04, 2002 11:43 AM
To: 'Ken Lehman'; '[EMAIL PROTECTED]'
Subject: RE: does perl have boolean variables?



Generally, people just use the not 0 = true, 0 or undef = false syntax.

So if you just change it to:

$seen = 1;

if($seen){
  do something...
}else{
  don't do it...
}

that would work.  I think you can also declare constants for this if you
really want to, but it's not that big of a pain.

-----Original Message-----
From: Ken Lehman [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 04, 2002 1:39 PM
To: '[EMAIL PROTECTED]'
Subject: does perl have boolean variables?


I can't say:

#!/yadayada/perl -w
use strict;

$seen = true;

if( $seen )
{
 #whatever
}
else
{
 #something different
}

I get a bareword error, I'm using perl 5.004_04. Does perl support booleans
like this, do I need to use a package?
Thanks in advance
-Ken

----------------------------------------------------------------------------
--------------------
The views and opinions expressed in this email message are the sender's
own, and do not necessarily represent the views and opinions of Summit
Systems Inc.


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

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




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

Reply via email to