#!/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)
In reply to Re: embed python script into perl script?
by Arunbear
in thread embed python script into perl script?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |