in reply to Replace Array Elements with Hash Values

Each element of @data has a newline (\n) at the end. You need to chomp before your comparison, but then need to add \n back before you print.

Update: I also think you really should use an array instead of a hash: @headers.

  • Comment on Re: Replace Array Elements with Hash Values