in reply to CGI send data to client

    >>send the result to client 2

It is not clear HOW you want data sent to client2.

If client2 runs a we browser, and expects data via CGI, then we are talking about a "chat" type application, and you need to consider ajax type async communication.

If client2 accepts data via a socket (possibly UDP), then the CGI script could potentially just dump it there.

Then , there are FIFO or memory-file or message-queue type options for other situations.

A little more clarity could get you better guidance.

                Memory fault   --   brain fried

Replies are listed 'Best First'.
Re^2: CGI send data to client
by Anonymous Monk on Dec 08, 2018 at 10:35 UTC

    Here are some other infos: client1 is on 1st machine and client2 on a second machine, both connected through the Web with the server. client2 is just a Perl script that needs to get the data, process it and display results in a simple Tk window. Yesterday I implemented my naive solution:

    • server writes in file what it receives from client1
    • client2 reads every x-time file from server by means of GET

    Of course it works, but even if I am at a beginner in client-server solutions, I know this is not the way to do it. I'll start having a look at "ajax type async communication" and what can I do in Perl.