in reply to Invisible characters

You could try Tip #3 from the Basic debugging checklist: Check for unprintable characters by converting them into their ASCII hex codes using ord
my $copy = $field1; $copy =~ s/([^\x20-\x7E])/sprintf '\x{%02x}', ord $1/eg; print ":$copy:\n";