From: Joel VanderWerf Date: 2008-03-15T15:12:00+09:00 Subject: Re: how to abruptly end a program? Tom Cloyd wrote: > I read in (p. 303) - ""If Ruby comes across a > line anywhere in the source containing just �_ _END_ _�, with no leading > or trailing whitespace, it treats that line as the end of the > program�any subsequent lines will not be treated as program code." > > That's not what's happening for me. The following - > _ _END_ _ > __END__ > _END_ > > all produce the same result for me - "undefined local variable or method" > That DOES bring the program to an abrupt end, but its rather ungraceful. > Is this the intended result - a crash due to an interpreter error? What the quote (a bit ambiguous perhaps) means is that the __END__ line and following lines are not treated as part of the program text. It has nothing to do with control flow. It's like comment block that runs to the end of the file without any explicit termination. (It's more than that because you can read it with DATA.) -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407