#!/usr/local/bin/perl -w

#

$x_odd = 1; $x_sum = 0;

# Main program starts here

print "Please enter up to 10 random numbers. When you are done\n";

print "type quit, and let this Perl program do its magic. ^_^\n";

print "\n\n";

print "Number: ";

while ($x = <STDIN>) {

if ($x == "\n") {

$z = @numbers;

print "count equals $z";

foreach $x (@numbers) {

($x %2 == 0) ? $x_sum += $x : $x_odd *= $x;

print "$x, $x_odd, $x_sum\n" }

print "sum = $x_sum, prod = $x_odd\n";

exit;

}

chomp ($x);

push (@numbers, $x);

}

#while ($number = <STDIN>) {

# print "Number: ";

# chomp($number);

# # # # if ($number-2*int($number/2) == 0) {

#$even += $number;

# } elsif (abs($number-2*int($number/2)) == 1) {

#abs reutrns the absolute value of its argument

# $odd *= $number;

# }

# }

#print "Your numbers are: $number";

#print "\n\n The odd numbers multipled would be: $odd";

#print "\n\n The even numbers sum is: $even";

;