open(INPUT, 'file.dat'); binmode(INPUT); while () { print $sock $_; } close(INPUT);