To expand on this, I think a succinct way of summarizing the issue is: you might have to run BEGIN blocks in Perl to parse the non-BEGIN-block part of the program. The canonical example of this is:
BEGIN {
if(arbitrary_function()) {
eval "sub whatever() { }; 1" or die $@;
} else {
eval "sub whatever { }; 1" or die $@;
}
}
# The parsing of this line depends on the result of arbitrary_function()
whatever / 25 ; # / ; die "this dies!";
arbitrary_function() can be anything, so the only way to parse the rest of the program is to actually run arbitrary_function().
That is true, but what the grandparent said is not: https://news.ycombinator.com/item?id=8626454
To expand on this, I think a succinct way of summarizing the issue is: you might have to run BEGIN blocks in Perl to parse the non-BEGIN-block part of the program. The canonical example of this is:
arbitrary_function() can be anything, so the only way to parse the rest of the program is to actually run arbitrary_function().