in reply to Can't get hash keys to print

My guess is that the lines in your input file terminate with a carriage return, but perhaps no line feed, so the hash keys in output are effectively being overwritten by the rest of that line. Try stripping trailling carriage returns ("\r") from the lines when you read them and see if that solves it for you.

Addendum: eg. replace the chomp $row; line with $row =~ s/[\r\n]+$//; or similar.

Replies are listed 'Best First'.
Re^2: Can't get hash keys to print
by ikegami (Patriarch) on Aug 24, 2015 at 15:12 UTC

    It's a Windows file. The lines end with CR+LF. I'd use

    $row =~ s/\s+\z//;

    You could also "fix" the file with command line util dos2unix.

Re^2: Can't get hash keys to print
by Daren (Initiate) on Aug 24, 2015 at 14:39 UTC
    Great catch!!! That was it. Thank you so much!