;) Hi guys....
I am a beginner at Perl, and i have some problemes I wanna solve!! I hope u can help me.
the exercise is:
Make a program that counts the number of positive and negative numbers in a column. Also count the zeroes in the column, if there are any. Display the result.
and make a program that finds the maximum and minimum number in a column. Display the result.
I tried this but it didnt work! :sad:
$i=0;
while( defined($line = <STDIN>) ) {
$i++;
}
print "Number of lines:$i\n";
and
$i=0;
while( defined($line = <STDIN>) > 0) {
$i++;
print "Number of positive numbers:$i\n";
}
elsif (defined($line = <STDIN>) < 0) {
$i++;
print "Number of negative numbers:$i\n";
else (defined($line = <STDIN>) = 0) {
$i++;
print "Number of 0's: $i\n";
peace
Soad