http://www.perlmonks.org?node_id=1042711


in reply to Newbie flabbergasted by string compare results

What did I do wrong here?

Hmm, to start with, having a sub main in your script is a bit unusual, since the main routine is the one not in any subroutine with Perl.

The dot (.) joining your comparison and the "\n" at the end of the lines to be printed does not stringify the result the way you expected it to. Use a comma (,) as a list operator instead and things will turn out to be just as you imagined.

Cheers, Sören

(hooked on the Perl Programming language)