in reply to exchanging strings on the network

Given that I didn't see the postings several layers deep, the post that follows my no longer be relevant. It remains anyway :-)
Dear bahudur,

First, the single-quotes wont work, since instead of passing the mod the actual host name, you're passing it the string '$host'.

Now, if you wanted to acquire your host and port from the command line, and you wanted to call your program like this:
./myprog.pl host.name.here 4567
, then you would get the hostname from $ARGV[0] and the port from $ARGV[1] (@ARGV holds stuff from the command line). Your structure should then be similar to:
my $client = IO::Socket::INET->new(PeerAddr => $ARGV[0], PeerPort => $ARGV[1], Proto => 'tcp');

If it works with hard-coded values, the above code should also work - if it doesn't, write back and maybe we can figure something out.

Hope this helps,
  -Adam