in reply to Re^4: Problems with Hash Keys and Spaces
in thread Problems with Hash Keys and Spaces

It looks like $temp[1] has a chr 13 at the end of it. Which OS are you on?

Replies are listed 'Best First'.
Re^6: Problems with Hash Keys and Spaces
by ZimCS (Novice) on Aug 08, 2008 at 17:13 UTC
    Unix
      Did the data in the array originate on Windows, and you chomped it? That would leave a chr 13 at the end of the string. Add
      $Data::Dumper::Useqq = 1;

      Just before the print Dumper.... If, as I suspect, it shows that $temp[1] really contains "Test MMA\r", you can use

      $temp[1] =~ s/\r//;

      to cleanse it.


      Unless I state otherwise, all my code runs with strict and warnings
        That is exactly it. I created a text file in windows, had it read into an array and chomped it. I will see if your solution works. Thanks!