in reply to TCP server with IO::Socket

Use

my ($method, $uri, $protocol) = $request_line =~ /(\V+) \040 (\V+) \04 +0 (\V+)/x;

instead of

my ($method, $uri, $protocol) = $request_line =~ /(.+) \040 (.+) \040 +(.+)/x;

You were matching a \r with . which caused the output to overwrite itself.

Replies are listed 'Best First'.
Re^2: TCP server with IO::Socket
by AlexP (Pilgrim) on Jul 21, 2021 at 09:09 UTC

    Huh! So weird. Thank you so mush =) It's a good lesson.

    I guess chomp might also help or just split first line by space.