Is perl meant to treat '\n' in regex as '\r\n' when running on windows?
I think the answer depends upon whether perl has been built for native windows (eg Strawberry Perl or ActivePerl) or whether perl has been built for (eg) Cygwin or MSYS.
What's your perl -V ?
Sounds like your problem would be fixed by running dos2unix on the hosts file.
(Running unix2dos on the same file will then revert it to its original form.)