Nicholas Clark wrote:
> 
> At the risk of going off topic, the Perl 5 source isn't exactly pleasant.
> And contains gotos. IIRC I added 2 between 5.6.0 and 5.8.0, but the
> alternative was a big mess of if()s and braces. C doesn't have all the
> nice loop labelling features of a certain other language.

In bleadperl :
$ perl -lne 'print if /\bgoto\b/' *.[ch] | wc -l
    605

This is a rough metric, there are probably less actual gotos than this
(because of comments and because "goto" is a perl keyword -- not
forgetting the yacc-generated code, that contains gotos as well).

However most of gotos appear to be in the tokenizer and in the regular
expression engine. Thoee are based on state machines, and IMHO gotos are
legitimate in state machines.

Reply via email to