or download this
@num = (2, 4, 5, 7);
use List::Util "reduce";
...
$asum = reduce { $b - $a } reverse @num;
$coeff = do { my @y = @num; while (1 < @y) { $y[$_] -= $y[$_ + 1] for
+0 .. @y - 2; splice @y, -1; } $y[0] };
print "lisp difference: $lsub\nalternating sum: $asum\nhighest coeff:
+$coeff\n";