use strict; use warnings; my ($i, $j, $x, $tot); my @exes; print "Please enter for how many values of x you will be finding the Standard Deviation.\n"; do {chomp($i=<>); print "\nPlease only use numbers.\n" if $i=~m/\D/;} until($i!~m/\D/ and $i=~m/\d/); print "\nPlease input the values of x, one at a time.\n"; for $j(1..$i){ do {chomp($x=<>); print "\nPlease only use numbers.\n" if $x=~m/\D/;} until($x!~m/\D/ and $x=~m/\d/); push @exes, $x;} undef $x; for(@exes){ $x=$x+$_;} my $ave=$x/$i; for(@exes){ $tot=$tot+(($_-$ave)^2);} my $deviation=sqrt($tot/$i); print "\nThe Standard Deviation of that set of numbers is $deviation.\n";