This its a trivial task with GNU-R. If you plan to go further and do more complex statistics in your data, I suggest you to take a look at the Statistics::R module in cpan and call directly R from perl. Something like:
use Statistics::R;
my $R = Statistics::R->new();
$R->run(q`mydata <-read.table("mydatafile",... more options here)`);
my $summary = $R->get(q`summary(mydata)`);
print $summary;
Only as a quick example and untested, but you can see that you will need to write less code to do the same. You can use any other statistic modules that you prefer of course