这是我的问题的最简单的可重现性:
#!/usr/bin/env perl
use 5.16.3;
say "Got back ", test_print();
use Inline Python => <<'END_OF_PYTHON_CODE';
def test_print() -> int:
print("In the python test print")
return 32
END_OF_PYTHON_CODE
简单运行时:
$ perl small.pl
In the python test print
Got back 32
但是当重定向时:
$ perl small.pl | tee foo
Got back 32
$ cat foo
Got back 32
我可能做错了什么,以至于Inline::Python代码无法打印到重定向的输出?