Socket Programming in Perl

Hi All
I am getting an error when using the below code
Receiver

use IO::Socket;
$sock = new IO::Socket::INET (LocalHost => 'goldengate',
LocalPort => 1200,
Proto => 'tcp',
Listen => 5,
Reuse => 1
);
die "Socket could not be created. Reason: $!" unless $sock;
while ($new_sock = $sock->accept()) {
while (defined ($buf = <$new_sock>)) {
print $buf;
}
}
close ($sock);

Sender

use IO::Socket;
$sock = new IO::Socket::INET (PeerAddr => 'goldengate',
PeerPort => 1200,
Proto => 'tcp',
);
die "Socket could not be created. Reason: $!\n" unless $sock;
foreach (1 .. 10) {
print $sock "Msg $_: How are you?\n";
}
close ($sock);

The Error is Socket could not be created.
Please provide the remediation for this..

What is 'goldengate'?

I just keep the the name of Local Host
I think we can keep it any , it doesn't effect anything right??

Is IP mapping is done to "goldengate" in your box where you are executing tour client program.

PeerAddr can be IP or hostname of the remote server.

That's Done, Thank You..
One more thing I want to ask, Is it possible to send the file (without opening it) through Socket.

It's not possible to send a file without opening it. Something, somewhere, must call the system call open() to access the file.