in reply to Odd Hash behavior

Just to satisfy curiosity and possibly detect a bug, try this:

Assuming that you know that your hash keys are supposed to contain only [A-Za-z0-9] you could make non-A-Za-z0-9 characters visible to detect them.

foreach my $key ( keys %part_file ) { $key =~ s/[^A-Za-z0-9]/Junk alert!/g; print "Key-$key-\n"; }

You would then expect your output to be something like:

Key-P123- Key-P334- Key-P925-

But on the other hand, if you get something like:

Key-P123Junk alert!Junk alert!- Key-P334Junk alert!

....then you'll be well on your way toward understanding why some of the other responses to your question advised you to be sure you're using chomp, or to watch for exterraneous characters that you didn't think were there.


Dave