I just wrote some testing python code into test.py
, and I'm launching it as follows:
perl test.py
After a while I realized my mistake. I say "after a while", because the Python code gets actually correctly executed, as if in Python interpreter!
Why is my Perl interpreting my Python? test.py
looks like this:
#!/usr/bin/python
...Python code here...
Interestingly, if I do the opposite (i.e. call python something.pl
) I get a good deal of syntax errors.
转载于:https://stackoverflow.com/questions/29563832/why-dont-i-get-any-syntax-errors-when-i-execute-my-python-script-with-perl