in reply to Re: Misunderstood array behavior
in thread Misunderstood array behavior

$VAR217 = 'MS01-9167-A7-DCIS'; ';AR218 = 'MS06-1878-D2-DCIS

If this is exactly what you get from data dumper, then there is a carriage return at the end of the line (hex 0D).

It might mean that you use a msdos file on unix and your chomp only removes the Line Feed and not the Carriage return . See the man page of chomp and its dependance on $/. Setting $/ to "\r\n" would correct that, but then real unix files would not work. If you need both file types to work, use a regex instead of chomp

About GrandFathers suggestion: Is the ordering of both files important to the result? If not you might put the second file into a hash instead of the first. But if you want helpful answers to that question you might open a new thread and tell us exactly what you want to do with those two files

Replies are listed 'Best First'.
Re^3: Misunderstood array behavior
by Anonymous Monk on Sep 20, 2008 at 17:25 UTC

    For Pete's sake...I never would have suspected that because it seemed to be stomping on memory. I've dealt with these different line endings before, but never ran into that behavior.

    Thanks a ton for everyone who helped. I have to mention that this has been the most pleasant forum I've ever worked with. Thanks!

    By the way, I'm using tchomp (http://cpan.uwinnipeg.ca/htdocs/Text-Chomp/Text/Chomp.pm.html) to solve the problem. Do you see any reason not to always use tchomp in place of chomp?

      If your separator isn't a standard newline at all, tchomp would fail. I posted an example using '>' recently.