Yes, strongly agree with your point about the impossibility of performing a static parse of Perl. Very annoying.
Thankfully, this has been fixed in Raku.
Years ago, I remember being in awe of adamk's tenacity in developing PPI after attending a few early talks at Sydney.pm --
sadly, that heroic effort may have burnt him out, at least he appears to have vanished from the Perl universe.
And I almost fell off my chair when I first read about TheDamian's astonishing PPR regex wizardry. :)
See also: Re: Perl script compressor by haukex - which mentions Guacamole.