#!/usr/bin/perl use strict; use IO::Socket; my $file1; my $sock = new IO::Socket::INET( LocalAddr => '192.168.100.30', LocalPort => 6224, Listen => 10, Proto => 'tcp', Reuse => 1, ); while(my $conn = $sock->accept()) { $file1=$_;#This should collect the filename send by client right? open(FILE,"$file1"); binmode(FILE); my @file = ; close(FILE); foreach my $x (@file) { print $conn $x; } }