in reply to Working with text files, thinking my issue is with variables inside if loops

Most likely it is due to the fact that your input lines contain newline characters at the end but you're comparing them to literal values which do not contain such newlines. Probably the easiest (though not necessarily the best) way to deal with this is simply to chomp the array of lines immediately after reading it:

chomp @lines;
There are numerous other optimizations you could make; I'll leave the pedants to show those to you.

I reckon we are the only monastery ever to have a dungeon stuffed with 16,000 zombies.
  • Comment on Re: Working with text files, thinking my issue is with variables inside if loops
  • Download Code