A small question

B

blaq.box

hi all

this is my first post to this group.
i have just started learning perl and
i am really amazed to find (infact couldn't find) that no keywords like
'true' or 'false' exist for perl. as we see in C/C++ etc.
experts please ensure me if i am right?

thanks for your time

blaq
 
A

A. Sinan Unur

this is my first post to this group.
i have just started learning perl and

The name of the language is Perl.
i am really amazed to find (infact couldn't find) that no keywords like
'true' or 'false' exist for perl. as we see in C/C++ etc. experts please
ensure me if i am right?

C does not have keywords true and false.

You might want to head on over to <http://learn.perl.org/> for resources
for beginners.

Sinan
 
S

Sherm Pendley

this is my first post to this group.

Welcome aboard. If you haven't done so already, please have a look at the
posting guidelines that appear here often. No, you haven't done anything
wrong, that's just a generic comment. :)
i am really amazed to find (infact couldn't find) that no keywords like
'true' or 'false' exist for perl. as we see in C/C++ etc.
experts please ensure me if i am right?

Well, you're right about Perl - it doesn't have 'true' or 'false' keywords.
C++ does, but C doesn't. C99 defines them as macros.

In C/C++, zero is false, non-zero is true. A NULL pointer is zero, so any
string is true. In Perl, as stated in 'perldoc perlsyn', "The number 0, the
strings '0' and '', the empty list (), and undef are all false in a boolean
context. All other values are true."

sherm--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top