I have started on this script for my class and I am stuck. I know I am and missing something but here please take a look. I am trying to get input from the user and then take all 10 numbers that are giving and do some math here. I want to take all the odd numbers that are giving and muiltiply them and the even sum them up. with a nice print out of all the numbers that where entered. Any help would be very nice. Thanks

Code

#!/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: ";

It is upon in this forum to ask help for ur school work. But, here are a few pointers, since you are using -w, you must be seeing some errors. Fix those first and then check the setting of your variables.

thats why I am not asking for you to do it for me. :) just where I am missing up. I am taking this class online. So I don't get any help at all. :( I have to read and therefore I have to then understand what I read. Really hard.

just taking a quick look at your revised code, it looks like the array @number is never being populated with any data. I assume that must be the list of numbers being entered, so make sure you populate the array before trying to run the sub routine, which you never call anywhere in the script anyway. sub Math is not going to run without being called first.

You will probably want to chomp the user input too each time a number is recieved or chomp the array before processing the data. I recommend you use"strict" too as that will assit you in coding your scripts properly.