Welcome to the Monastery adilord.
Your question sounds like homework. Why not post the code you've tried so far (surrounded by <code>...</code> tags, and the Monks will be sure to help you. | [reply] [d/l] |
Since you have shown no code, I will assume you do not know how to create code for any of the tasks you mentioned. So, I will point you to some documentation here at the Monastery which should show some examples of the types of things you want to do. The Tutorials section is a great resource.
For example, to prompt the user, take a look at Basic Input and Output.
Search for "case-insensitive" in the perlrequick section of the official Perl documentation.
| [reply] |
Assuming you are using ActiveState Perl, you can use the prompt function from the ActiveState::Prompt module. It does all you want and more: use strict;
use warnings;
use ActiveState::Prompt qw/prompt/;
my $answer = prompt('Please enter a, A, b, B',
must_match => [qw/a A b B/],
no_match_msg => 'a, A, b or B only please!',
);
print $answer;
CountZero A program should be light and agile, its subroutines connected like a string of pearls. The spirit and intent of the program should be retained throughout. There should be neither too little or too much, neither needless loops nor useless variables, neither lack of structure nor overwhelming rigidity." - The Tao of Programming, 4.1 - Geoffrey James
| [reply] [d/l] [select] |
You can use simple if, elsif and else. To get ASCII character see, ord function. To print in reverse order, see chr function. | [reply] |
This sounds pretty straight-forward and easy. | [reply] |