![]() |
|
Think about Loose Coupling | |
PerlMonks |
AnyEvent::Socket -> Hosts File -> CR/LF Issue on windows?by sectokia (Pilgrim) |
on Feb 08, 2022 at 02:44 UTC ( #11141216=perlquestion: print w/replies, xml ) | Need Help?? |
sectokia has asked for the wisdom of the Perl Monks concerning the following question: Hi Monks, I was tracking down my issue with IP's in hosts file not resolving when using AnyEvent on Windows. I was eventually lead to this code in AnyEvent::Socket.pm:
The problem is on windows the lines in the hosts file end with '\r\n'. But this code only splits on '\n'. So whats happening is '\r' ends up literally in the (last) alias, and thus it will never match when later the attempt is made to match the hostname to the alias. Is this a mistake in this module? Or have I somehow messed up and perl on windows? Is perl meant to treat '\n' in regex as '\r\n' when running on windows?
Back to
Seekers of Perl Wisdom
|
|