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

    • For those who don't use ack, this is exactly the sort of thing ack was designed to do easily.

      find perl-5.10.0 -name ext -prune -o '(' -type f -iname '*.c' -or -iname '*.cpp' -or -iname '*.h' ')' -exec cat {} \; | egrep '\bgoto\b' | wc -l

      is just

      ack --cc --cpp -w goto perl-5.10.0 | wc -l

      --cc means "C source and headers only", --cpp is "C++ source and headers only", -w means "word only".

      Just install CPAN package App::Ack.

      --

      --
      xoa