http://www.perlmonks.org?node_id=949480


in reply to embed python script into perl script?

It is possible, though it seems like a false economy. Here is another method:
#!/usr/bin/perl use autodie; use strict; use warnings; my $code = do { local $/; <DATA> }; my $result = qx/python -c '$code'/; print "$result\n"; __DATA__ def cube(x): return x * x * x print "the cube of 2 is %d" % cube(2)