Yep. Nowadays Erlang (or Elixir) would be my tool of choice for that, but before discovering those (or when that felt like overkill) a quick Perl script would be my way to go.
Incidentally, apply this to web requests/responses and you've invented CGI (where Perl was incredibly useful, even if PHP happened to be a bit more popular).
Incidentally, apply this to web requests/responses and you've invented CGI (where Perl was incredibly useful, even if PHP happened to be a bit more popular).