
davorg
Thaumaturge
/ Moderator
Dec 1, 2003, 7:39 AM
Post #8 of 8
(2811 views)
|
|
Re: [madhu_p] " IF " Statments ..
[In reply to]
|
Can't Post
|
|
Iam sorry ,iam wrong 'else 'will not have condition but I think 'else' will follow 'elsif'(ref:programming perl O'reilly : page no:94) Please include the edition number when referencing pages in books as they can change between editions. Page 94 of the most recent (3rd) edition has nothing to say about if, elsif or else. But on page 113 it has the following examples of compound logical statements:
if (EXPR) BLOCK if (EXPR) BLOCK else BLOCK if (EXPR) BLOCK elsif (EXPR) BLOCK ... else BLOCK Which does, I confess, imply that an "elsif" block must have a following "else" block, but it's not true. As simple experimentation would have shown. The "else" block is _always_ optional. I'll submit a patch to the documentation. -- Dave Cross, Perl Hacker, Trainer and Writer http://www.dave.org.uk/ Get more help at Perl Monks
|