That's exactly why I wanted to print "(@{$head})". It would tell me if $head contained stuff that shouldn't be there. The OP told me the following, "When I ran the script it printed: Field names detected: (# de tienda tipo ubicacion". I should have known -- because he didn't show me the closing paren ')' -- that his report to us was incomplete, and should have suspected that it lacked exactly the piece of information we were looking for.
That doesn't excuse my not having seen "undef $/" earlier in the script, but had he reported the full output, or had I noticed that his report was incomplete, it would have led us to look for the modification of $/ sooner even though it was at first not noticed.