This is just a matter of syntax, right? So could it be determined by a stack machine? Unfortunately, the answer is no. Perl is not context free!
https://perlmonks.org/?node_id=663393
As just a guess, this question maps to the Halting Problem. (EDIT: That would have to be the question where the input is a programming language, not just for Perl. That question has been answered empirically.)
This is just a matter of syntax, right? So could it be determined by a stack machine? Unfortunately, the answer is no. Perl is not context free!
https://perlmonks.org/?node_id=663393
As just a guess, this question maps to the Halting Problem. (EDIT: That would have to be the question where the input is a programming language, not just for Perl. That question has been answered empirically.)