in reply to ipconfig output encoding ( 0D 0D 0A )

notepad don't show extra newlines

Because there aren't any extra newlines. There is an extra carriage return. Probably just somebody wrote print "...\r\n"; for whatever reason and the Win32 C RTL layer turned "\n" into "\r\n" giving "\r\r\n".

Just another reason to ignore trailing whitespace on the ends of lines. Use s/\s+$//; instead of chomp. It makes for better-behaved programs.

- tye