in reply to AnyEvent::Socket -> Hosts File -> CR/LF Issue on windows?

It depends on how the file was opened. If you open it with :crlf (which is the default on MSWin), \r\n will be converted to \n when reading the file. I have no idea how the hosts file is opened in AnyEvent::Socket, though.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Replies are listed 'Best First'.
Re^2: AnyEvent::Socket -> Hosts File -> CR/LF Issue on windows?
by syphilis (Archbishop) on Feb 08, 2022 at 10:53 UTC
    If you open it with :crlf (which is the default on MSWin)

    If you're running perl "on Cygwin on MSWin" it looks to me that :crlf is not the default.
    I therefore deduce that you regard running perl "on Cygwin on MSWin" as not running perl "on MSWin".

    (Just trying to clear up exactly what it means to be "on MSWin".)

    Cheers,
    Rob
      Yeah, by "running perl on MSWin" I mean
      $^O eq 'MSWin32'
      map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
        > $^O eq 'MSWin32'

        which is IMHO the central point when talking about newline problems in hybrid situations like WSL or Cygwin

        Cheers Rolf
        (addicted to the Perl Programming Language :)
        Wikisyntax for the Monastery