#!/usr/bin/perl use Modern::Perl; # Providers a total sum of any number of integers entered print "Please enter a number (neg value to end): "; my $input = <>; chomp $input; my $count = 1; my $smallest = $input; my $largest = $input; my $sum = $input; while ($input > -1) { print "Please enter a number (neg value to end): "; $input = <>; chomp $input; if ($input > -1) { if ($input < $smallest && $input > -1) { $smallest = $input; } if ($input > $largest) { $largest = $input; } $sum += $input; $count++; } } if ($sum < 0) { print "NO NUMBERS ENTERED\n"; } else { print "$largest:$smallest:"; print $sum/$count; say ""; }