in reply to Re^4: socket checker in multiple hosts for multiple destination
in thread socket checker in multiple hosts for multiple destination

You have

open( my $data_fh, ">", $file2 ) or die "Could not open [$file2] [$!]";

which opens the $file2 for writing

To read from it use

open( my $data_fh, "<", $file2 ) or die "Could not open [$file2] [$!]";
poj