Re: Ending a compound statement

2003-12-20 Thread drieux
On Dec 19, 2003, at 8:46 PM, Kenton Brede wrote: On Thu, Dec 18, 2003 at 12:37:33PM -0800, drieux wrote: [..] I've worked with the examples you have shown and I have to admit I'm just not advanced enough to follow your approach. I'll ask a few questions in hopes of getting a little closer to under

Re: Ending a compound statement

2003-12-19 Thread Kenton Brede
On Thu, Dec 18, 2003 at 12:37:33PM -0800, drieux wrote: > > On Dec 18, 2003, at 11:35 AM, Kenton Brede wrote: > http://nixnotes.org/perl_dump.html Thanks for everyones response first of all. > So first things first, Do You REALLY want to > know what @ARGV was prior to calling GetOptions? Poin

Re: Ending a compound statement

2003-12-18 Thread drieux
On Dec 18, 2003, at 11:35 AM, Kenton Brede wrote: [..] I've posted the following code to use as an example. Any critique of the code in addition to my specific question is welcome:) I just don't see a reason to stick an "else" statement on the end of that block. http://www.nixnotes.org/perl_dump.

Re: Ending a compound statement

2003-12-18 Thread Owen
On Thu, 18 Dec 2003 13:35:17 -0600 Kenton Brede <[EMAIL PROTECTED]> wrote: > Does a compound statement need to end with an "else" ? Technically No. But what if you haven't covered all the options? So I would suggest adding after the last elsif } elsif ($string[0] =~ m/^\w/) { # limit search st

RE: Ending a compound statement

2003-12-18 Thread Bob Showalter
Kenton Brede wrote: > Does a compound statement need to end with an "else" ? No. > > I know - > > if (expression) { > statement; > } elsif (expression) { > statement; > } > > works but I've never seen a block like that in a book yet. I usually > see something like - > > if (exp

RE: Ending a compound statement

2003-12-18 Thread Guay Jean-Sébastien
Hello Kenton, It depends on what you want to do. There is not really a "right way", since the two series of statements you mention will lead to different results. (I added numbers to the different parts of your examples, makes them a bit easier to follow) > if (expression1) { > statement1;

Ending a compound statement

2003-12-18 Thread Kenton Brede
Does a compound statement need to end with an "else" ? I know - if (expression) { statement; } elsif (expression) { statement; } works but I've never seen a block like that in a book yet. I usually see something like - if (expression) { statement; } elsif (expression) {