RE: Change in goto behavior

2005-07-14 Thread Cliff Bamford
Dijkstra should have titled his letter Stupid programmers considered harmful. A good programmer will write good code no matter how liberal the language, and a bad programmer will write bad code no matter how restrictive the language. Since someone asked, there's one situation where goto's are

Re: Change in goto behavior

2005-07-14 Thread Michael Erskine
On Thursday 14 July 2005 03:26, Hugh Loebner wrote: My previous message was attached to the wrong posting. I doubt very much whether there is any occasion where gotos are most appropriate. Please provide an example. TMTOWTDI :) -- Do nothing unless you must, and when you must act --

Re: Change in goto behavior

2005-07-14 Thread Lloyd Sartor
$Bill Luebkert [EMAIL PROTECTED] wrote on 07/13/2005 10:36:04 PM: In structured programming practice, a goto would be totally inappropriate. But ... when you look at how a switch is implemented in actuality, it's full of goto's. I guess the point is that you should leave the gotos to

RE: Change in goto behavior

2005-07-14 Thread Ken Cornetet
Cc: perl-win32-users@listserv.ActiveState.com Subject: Re: Change in goto behavior My previous message was attached to the wrong posting. I doubt very much whether there is any occasion where gotos are most appropriate. Please provide an example. Check ot http://www.acm.org/classics/oct95/ Go

Re: Change in goto behavior

2005-07-14 Thread John Deighan
At 09:55 AM 7/14/2005, Lloyd Sartor wrote: My opinion is that the goto statement can be useful in error handling situations, particularly when parsing data. This removes the rarely-executed error handling code from the expected, normal processing code. This makes the normal code more cohesive,

RE: Change in goto behavior

2005-07-14 Thread Cliff Bamford
Oh puleeze. Edsger was a very nice guy, but he was hardly one of the most brilliant minds in computer science --- and he certainly would have disapproved of Perl, whose author truly is a giant. Djiskstra hated one-liners -- since his main interest was mathematical proof of correctness, he

Re: Change in goto behavior

2005-07-13 Thread Hugh Loebner
Why on earth are you using a goto statement? They are pernicious. HLOn 7/12/05, Dave Ressler [EMAIL PROTECTED] wrote: I have noticed a change in behavior in goto statements recently. Whereas a statement like goto PLACE; would work fine no matter where PLACE:was in my code, I've noticed

Re: Change in goto behavior

2005-07-13 Thread John Deighan
At 08:30 AM 7/13/2005, Hugh Loebner wrote: Why on earth are you using a goto statement? They are pernicious. We have a goto in our code. I hate it, but there just isn't a good switch or case statement in Perl yet (I think I've heard that it's planned), and the following just isn't efficient

RE: Change in goto behavior

2005-07-13 Thread Thomas, Mark - BLS CTR
John Deighan wrote: We have a goto in our code. I hate it, but there just isn't a good switch or case statement in Perl yet Yes there is, in Perl 5.8. If you're using an older Perl, you can still get Switch.pm from CPAN. use Switch; switch ($val) { case 1 { print

Re: Change in goto behavior

2005-07-13 Thread Michael Erskine
On Wednesday 13 July 2005 13:30, Hugh Loebner wrote: Why on earth are you using a goto statement? They are pernicious. On the contrary, a goto is often most appropriate in expressing clear program flow. Regards, Michael Erskine -- Kinkler's First Law: Responsibility always exceeds

RE: Change in goto behavior

2005-07-13 Thread Joe Discenza
John Deighan wrote, on Wed 7/13/2005 09:55 : We have a goto in our code. I hate it, but there just isn't a good "switch" or "case" statement in Perl yet (I think I've heard : that it's planned), and the following just isn't efficient enough for us:: if ($op = 'thisop') {: }: elsif ($op =

RE: Change in goto behavior

2005-07-13 Thread Anderson, Mark (Service Delivery)
-Original Message- From: [EMAIL PROTECTED] [SMTP:[EMAIL PROTECTED] Sent: Wednesday, July 13, 2005 2:55 PM To: perl-win32-users@listserv.ActiveState.com Subject: Re: Change in goto behavior *** WARNING : This message originates from the Internet *** At 08:30 AM 7/13/2005, Hugh

RE: Change in goto behavior

2005-07-13 Thread Gardner, Sam
Title: Message John, Look up function dispatch tables on perlmonks.com. It's a pretty good alternative to switch case statements (better than if-else, anyway). But as to your question, I don't know if there was any functionality change made. Sam Sam Gardner

RE: Change in goto behavior

2005-07-13 Thread Peter Eisengrein
At 08:30 AM 7/13/2005, Hugh Loebner wrote: Why on earth are you using a goto statement? They are pernicious. We have a goto in our code. I hate it, but there just isn't a good switch or case statement in Perl yet (I think I've heard that it's planned) It's not a case/switch, but you

Re: Change in goto behavior

2005-07-13 Thread Johan Lindstrom
At 15:55 2005-07-13, John Deighan wrote: but that's another matter. (We initially used a goto FINISH, but I hated that, too. You can use a break if you're in a loop.) We use a method that I really don't have time to describe now, but doesn't use a goto. I hate goto's, but for the example

RE: Change in goto behavior

2005-07-13 Thread John Deighan
At 10:46 AM 7/13/2005, Thomas, Mark - BLS CTR wrote: John Deighan wrote: We have a goto in our code. I hate it, but there just isn't a good switch or case statement in Perl yet Yes there is, in Perl 5.8. If you're using an older Perl, you can still get Switch.pm from CPAN. Great to know,

RE: Change in goto behavior

2005-07-13 Thread Gardner, Sam
Title: RE: Change in goto behavior This kind of flexibility in a switch statement reminds me why I love perl. Sam Gardner GTO Application Development Keefe, Bruyette Woods, Inc. 212-887-6753 -Original Message- From: Thomas, Mark - BLS CTR [mailto:[EMAIL PROTECTED

Re: Change in goto behavior

2005-07-13 Thread Lou Losee
There is also discussion about implementing SWITCH equivilents in the perldoc for perlsyn under the heading 'Basic BLOCKs and Switch Statements'. Lou On 7/13/05, Thomas, Mark - BLS CTR [EMAIL PROTECTED] wrote: John Deighan wrote: We have a goto in our code. I hate it, but there just isn't a

RE: Change in goto behavior

2005-07-13 Thread Peter Eisengrein
if ($choice !~ /^sub[12]$/) { badchoice; } else { {$hash{$choice}}; } Actually this if statement should've been if ($hash{$choice}) { {$hash{$choice}}; } else { badchoice; } Much more gooder than the regex.

Re: Change in goto behavior

2005-07-13 Thread Hugh Loebner
I doubt this. Please provide an example. HLOn 7/13/05, Michael Erskine [EMAIL PROTECTED] wrote: On Wednesday 13 July 2005 13:30, Hugh Loebner wrote: Why on earth are you using a goto statement? They are pernicious.On the contrary, a goto is often most appropriate in expressing clear programflow.

Re: Change in goto behavior

2005-07-13 Thread Hugh Loebner
My previous message was attached to the wrong posting. I doubt very much whether there is any occasion where gotos are most appropriate. Please provide an example. Check ot http://www.acm.org/classics/oct95/ Go To Statement Considered Harmful by Edsger W. Dijkstra On 7/13/05, Michael

Re: Change in goto behavior

2005-07-13 Thread $Bill Luebkert
Hugh Loebner wrote: My previous message was attached to the wrong posting. I doubt very much whether there is any occasion where gotos are most appropriate. Please provide an example. Check ot http://www.acm.org/classics/oct95/ Go To Statement Considered Harmful by Edsger W. Dijkstra

Re: Change in goto behavior

2005-07-13 Thread David Dick
Hugh Loebner wrote: My previous message was attached to the wrong posting. I doubt very much whether there is any occasion where gotos are most appropriate. Please provide an example. Check ot http://www.acm.org/classics/oct95/ Go To Statement Considered Harmful by Edsger W. Dijkstra

Re: Change in goto behavior

2005-07-12 Thread $Bill Luebkert
Dave Ressler wrote: I have noticed a change in behavior in goto statements recently. Whereas a statement like goto PLACE; would work fine no matter where PLACE: was in my code, I've noticed that scripts that used to work are now failing at the goto statement. Guess what Dave - I don't believe

Re: Change in goto behavior

2005-07-12 Thread Sisyphus
- Original Message - From: Dave Ressler [EMAIL PROTECTED] To: Perl List perl-win32-users@listserv.ActiveState.com Sent: Wednesday, July 13, 2005 11:06 AM Subject: Change in goto behavior I have noticed a change in behavior in goto statements recently. Whereas a statement like goto