in reply to [perlrun; perlre] $_ seems aliased instead of copied in assignment... why?
Simpler explanation: your substitution fails on certain lines. Remember the rule, Without error checking and sample data, it's your bug -- not Perl's!.