$sum = 0;
@numbers = (24, -4, 2.42, 494.02, 120, 0, 1, 0, 1.22);
 
foreach $i (@numbers) {
  $sum += $i;
}
 
$count = $#numbers + 1;
$average = $sum/$count;
$variance_acc = 0;
 
foreach $i (@numbers) {
    $variance_acc += ($i - $average)**2;
}
 
$stddev = sqrt($variance_acc/($count - 1));
print "Average: $average\nStandard deviation: $stddev\n";