This question already has an answer here: Why don't I get any syntax errors when I execute my Python script with Perl? (1 answer) Closed 5 years ago .

Today I was building a tokenizer for English language in Python and I mistakenly executed the script with Perl. I was surprised to find out that Perl actually compiled this Python code and gave correct results.

So my question is how Perl is able to compile/interpret Python scripts as it should be completely unaware of the python syntax, semantics and all other information required by a compiler/interpreter to compile/interpret a code?