CLIENT.pl #!/usr/bin/perl use strict; use IO::Socket; $file="file1.txt" #This is the file to be opened in server side my $sock = new IO::Socket::INET( PeerAddr => '192.168.100.30', PeerPort => 7880, Proto => 'tcp', ); print $sock "$file"; open(FILE,">file.txt"); binmode(FILE); while(<$sock>) { print FILE $_; print FILE <$sock>; } close(FILE);