I ran the following program:
% /usr/bin/perl /usr/share/dict/words Semicolon seems to be missing at /usr/share/dict/words line 56367. Semicolon seems to be missing at /usr/share/dict/words line 58414. Semicolon seems to be missing at /usr/share/dict/words line 72599. Semicolon seems to be missing at /usr/share/dict/words line 104537. Bareword found where operator expected at /usr/share/dict/words line 109459, near "Maarten" (Might be a runaway multi-line MM string starting on line 109455) Semicolon seems to be missing at /usr/share/dict/words line 124219. Semicolon seems to be missing at /usr/share/dict/words line 136839. Bareword found where operator expected at /usr/share/dict/words line 161158, near "qere" (Might be a runaway multi-line qq string starting on line 161157) Semicolon seems to be missing at /usr/share/dict/words line 167505. Bareword found where operator expected at /usr/share/dict/words line 171985, near "sab" (Might be a runaway multi-line ss string starting on line 171980) syntax error at /usr/share/dict/words line 4650, near "Alaric alarm " No such class Mya at /usr/share/dict/words line 121337, near "muzzy Mwa my Mya" "no" not allowed in expression at /usr/share/dict/words line 124778, at end of line No such class Ouranos at /usr/share/dict/words line 133287, near "ouphe ouphish our Ouranos" Illegal declaration of subroutine main::subabbot at /usr/share/dict/words line 191503.
.. and wondered why I was getting such perplexing errors. Then I realised that I had omitted the name of the script, and was thus executing the word list file.
This reminds me of the time at school when I tried to compile a COBOL program with a Pascal compiler. I got a thick stack of fan-fold back from the computer room. Page after page of errors. It did nearly manage to parse one line correctly, when it got to
PROCEDURE DIVISION
... but apart from that it recorded several thousand syntax errors. I like it when programs march on stubbornly in the face of impossible odds. It makes me feel smarter than them.
There is historical justification for a compiler to do this. Back in the days of punch cards and line printers, the time between submitting a job to compile a program and seeing the result was measured in minutes, hours, or days. So, it was extremely important for the compiler to tell you about as many errors as possible in a single run so that you could fix as much as possible before sending the job back again.
Nowadays, with interactive computers, the sumit/run/result cycle is measured in fractions of a second - so you just fix the first error and don't even try to figure out which of the following errors are cascaded consequences of the first and which are separate errors but just compile it again immediately.
Re:on the other hand...
grinder on 2006-07-26T11:13:36
Hey, better late than never, and it's a good point.
I took a closer look at the file. Line 56367 seems pretty boring, although line 56366 is much more interesting. It contains the word
doTo avoid this error in future, I think the addition of the keyword "aardvark" to the language would be of vital importance. There's just the small detail of figuring out what it would do.