in reply to Re^4: session expiry
in thread session expiry

Have you looked at what line 50 is?

You are not checking whether creating your REPORT file succeeds. Change

open REPORT, ">> ...";
to
open REPORT, '>>', $report_file or die "Couldn't append to REPORT file '$report_file';

You are not checking whether creating $sock1 succeeds. But you still blindly try to write to it, which might or might not cause your error.

As an aside, you have commented out use strict;. Why?

Replies are listed 'Best First'.
Re^6: session expiry
by trelane (Initiate) on May 26, 2010 at 10:01 UTC
    Sorry, my mistake when I was uploading the script I removed some commented out lines, so line 50 is:
    print $sock1 "$mac1";
    So it is trying to, if i read this right, send the MAC to the IP2 on port 5555, but fails because it cannot write to it.

      Right. $sock1 did not connect, and you never know about that because you only check whether $sock connects.