How strong is your calculus? That's what you're going to need to use to optimize cuttings. How much does the problem change from instance to instance? If there is a significant change from problem to problem, you may want to invest in
Mathematica, or a similar program, to allow you to do math. (You could use Inline::C to link to their libraries from Perl, or just use straight C. And, FAIK, they've added Perl / Java / whatever bindings.