develooper Front page | perl.beginners | Postings from December 2002

trouble with case-sensitivity

Thread Next
From:
Andrew F.
Date:
December 5, 2002 07:41
Subject:
trouble with case-sensitivity
Message ID:
003e01c29c74$816b7dc0$1302a8c0@KALDRENON
    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?

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About