in reply to Re: multiple connections
in thread multiple connections

clint, the problem is, at the moment i am writing to a single file, it may be better to write different file for different connections, because i have a php script that processes the data, how can i achieve this? thank k-

Replies are listed 'Best First'.
Re^3: multiple connections
by clinton (Priest) on May 18, 2007 at 18:51 UTC
    Writing to a single file shouldn't be a problem. Do you mean that the problem is that you want to separate the data from the different connections? If so, you could prepend an ID or something to the beginning of the line to distinguish between connections:

    print $log "$connection : $buf";

    or you could use the same logic to open different files :

    open ($log,'>>',"log_$connection.txt") or die $!;

    ...where $connection is a variable that increments for every new connection that opens, or is based on the IP address, or whatever is meaningful to you.

    Have I understood the problem correctly?

    hth

    clint