Using libRmath from Perl scripts

The following shows a Perl script that calls libRmath to calculate the Student's t-distribution. It takes each line of input and calculating the t-distribution P(T<t) for the first number with the second number (tab separated) giving the degrees of freedom.

It illustrates several points about how to use Inline::C, including the use of prefixes and library inclusion.