Possibly the chomp-ed $line still has a carriage-return at the end of it.
c:\@Work\Perl\monks>perl -wMstrict -le
"my $line = qq{01234567\x0d};
print qq{It was $line!!!\n};
"
!!!was 01234567
This might arise if, e.g., the file had been created on a Windows system (with \x0d\x0a line-enders) and then transferred to a *nix system without proper newline translation. On the *nix system, chomp will take care of the \x0a but leave the \x0d untouched.
(BTW: It may or may not be too stupid, but the reason I know about this sort of thing is that I've done it myself — and more than once!)