people using a 'sub ()' prototype for anything except a CONSTANT_NAME will be taken behind the bikeshed, shot, eviscerated, cremated, resurrected, shot again, and then told it's now their responsibility to project manage the repainting as penance.
"Modern" Perl programmers use a lot of syntax-perverting trickery,
so this isn't as unlikely as it may appear.
"Modern" Perl programmer do the complete opposite!This code completely ignores all the best practices that "Modern" Perl programmers adhere to so its is very unlikely to appear anywhere but in places like Perlmonks, Reddit & Hacker News ;-)
just because a pathological case is possible, doesn't mean that it's actually common, or even existent.
Similarly it's possible to prove that a certain block of code does nothing but link in such deterministic units, removing the nondeterminism of function prototypes.
Most of the source code out there can be parsed statically without resorting to anything drastic. The semantics of this hypothetical Perl 5 variant do differ, but as a strict subset it will still properly most of the useful code out there.
Also, what you're describing is no longer static parsing.
Try this one:
This is technically parseable but only by thinking of it as a program that branches at every call of 'foo'. And think about what would happen if many such cases interacted."Modern" Perl programmers use a lot of syntax-perverting trickery, so this isn't as unlikely as it may appear.