If you are going to do an equality comparison, you can leave out the regex.

  if(lc($again) eq 'y'){

should work.

-----Original Message-----
From: Andrew F. [mailto:[EMAIL PROTECTED]]
Sent: Thursday, December 05, 2002 7:40 AM
To: [EMAIL PROTECTED]
Subject: trouble with case-sensitivity


    I wrote a simple program, and I decided to put a piece at the end which
would allow the user to start the program over. I did it like this:

    print "\n\n" . 'Do you want to do another comparison (Y or N)?' . "\n";
    $again = <STDIN>;
    if ($again == /'y'/i) {;
      goto compare;
      };

    But I am having trouble getting it to use only 'y', and not every input
containing it. I had thought that using == instead of =~ would work but it
didn't. the string equality (eq) didn't work either. Any suggestions?

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to