in reply to Syntax trouble?
Hello IISGUY,
A few suggestions in addition to what's been said:
The first two pragmas (use strict; use warnings) are *musts. The second two items *(use diagnostics; use Data::Dumper;) will give you additional information on any errors your script may be returning.use strict; use warnings; use diagnostics; use Data::Dumper;
my $num1=$ARGV[0]; my $num2=$ARGV[1];
# 1 # Ask the user for two numbers # 2 # while the first number is less than the second; # add 1 to the first number # then print out the second #^# THAT'S THE CONDITION YOU WANT #^# #3 #v# NOW DESCRIBE WHAT CAN GO WRONG AND WHAT TO DO ABOUT IT #v# # if the user enters less than two numbers # say to the user: "you didn't give me two numbers" # if the user enters more than two numbers # say to the user: "you gave me too many numbers
I hope this helps. Good luck!
Update 04:07:24 PM -0400 on Saturday, 5/28/11: added notes on later Perl versions and Data::Dumper.
|
|---|