On Mon, 7 Jul 2003 18:38:03 +0900, Brian Candler <B.Candler / pobox.com>
wrote:

>No, there cannot be such a solution.
>
>Ruby runs programs by
>(1) parsing the code, and converting to an Annotated Syntax Tree
>(2) running the AST
>
>If step 1 fails, no code will run at all.
>
>Brian.
>

I am convinced.  So Ruby BEGIN differs from Perl BEGIN.  Alas I'd say:
check tail of http://www.oreilly.com/catalog/pperl3/chapter/ch18.html
Compare:

modena:gv/klad-: cat try
BEGIN {
   print "In Perl will be parsed and run first, irrespective of parse
errors past BEGIN\n";
}

# Syntax errors.
%&^&$%
modena:gv/klad-: ruby try
try:6: parse error
%&^&$%
     ^
modena:gv/klad-: perl try
In Perl will be parsed and run first, irrespective of parse errors past
BEGIN
syntax error at try line 6, at EOF
Execution of try aborted due to compilation errors.
modena:gv/klad-: