in reply to Why does this compile? [Solved]

Do you mean the absence of a semicolon before the __END__? Even this compiles and runs:
$nose !~/fubar/ and say "Super!"__END__

The __END__ token just tells Perl "stop reading the source right here". perlsyn says "Every simple statement must be terminated with a semicolon, unless it is the final statement in a block, in which case the semicolon is optional". This is exactly the optional case.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: Why does this compile?
by karlgoethebier (Abbot) on Nov 25, 2024 at 18:44 UTC

    Doh! I am somewhat surprised. I didn't think of the idea with the block. I connect block with curly brackets. But Perl is jesuitically sophisticated. From ibidem:

    ” In Perl, a sequence of statements that defines a scope is called a block. Sometimes a block is delimited by the file containing it (in the case of a required file, or the program as a whole), and sometimes a block is delimited by the extent of a string(in the case of an eval). But generally, a block is delimited by curly brackets, also known as braces. We will call this syntactic construct a BLOCK. Because enclosing braces are also the syntax for hash reference constructor expressions (see perlref), you may occasionally need to disambiguate by placing a ; immediately after an opening brace so that Perl realises the brace is the start of a block. You will more frequently need to disambiguate the other way, by placing a + immediately before an opening brace to force it to be interpreted as a hash reference constructor expression. It is considered good style to use these disambiguating mechanisms liberally, not only when Perl would otherwise guess incorrectly.”

    In this case, the entire program - or main.

    Thanks and regards, Karl