Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Sadly goto is a useful construction in C, because the flow control primitives are, well, far more primitive than Perl. For example, you can only break out of the innermost loop.

    Perl's goto has something that isn't offered by C or PHP - goto &NAME [perl.org]. That form is really the only form that anyone should be using in Perl code, and then only when they know what they're doing and why. I don't know PHP, but either it has flow control structures as powerful as Perl's, in which case goto is not needed, or the f

    • Thanks for providing more accurate (or.. much more accurate) finds

      I also liked the explanation you gave on the use of gotos. I had a discussion about that with a colleague (who is a Python programmer) and we got around to labels and I tried to explain that Perl has label-aware loop commands. That you can last to a label. In PHP, you can continue an amount of loops outside (continue 3 would exit 3 loops above) while apparently in Python you can't do either, only break and loop.

      I guess what I'm saying is that there's a lot of ways to peel an onion (I know at least two!), and a lot of ways to construct a better workflow in dynamic programming languages, but the language developers have to think that a programmer might want/need it and then provide it. Thus, as you put it (but I'll rephrase), either PHP isn't good enough to overcome goto or they've added something that isn't required for no good reason (since it's not required).

      The only time I've personally ever used goto was assembly programming