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

trouble with case-sensitivity

Thread Next
Andrew F.
December 5, 2002 07:41
trouble with case-sensitivity
Message ID:
    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 Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About