>>>>> "SF" == Shlomi Fish <shlo...@iglu.org.il> writes:

  SF> Well, some use cases for goto in C:

  SF> 1. Breaking out of more outer loop (as there is no "continue label;" or 
"break 
  SF> label;" in C:

  SF> <CODE>
  SF> for (i=0 ; i < len ; i++)
  SF> {
  SF>   for (j = 0....
  SF>   {
  SF>           if (func(i, j)
  SF>           {
  SF>                   goto after_loops;
  SF>           }
  SF>   }
  SF> }

wrap the loops in a sub and return. no goto needed.

  SF> 2. Another is the de-allocation of resources at the end of the
  SF> function with checking for failure:

i gave a solution to this in another post. goto is not needed. this is a
crutch for poor coders. you design to not need such constructs. if you

  SF> I should note that in C "continue", "break", and a pre-mature
  SF> "return" may also be considered as pseudo-gotos.

huh? same as perl then.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to