#!/usr/bin/env perl use strict; use warnings; use IO::Socket; my $client = IO::Socket::INET::->new( Proto => 'tcp', PeerAddr => 'localhost', PeerPort => 55555, ) || die "Can't open client socket: $IO::Socket::errstr"; for my $send_num (1 .. 5) { $client->print(<<"EOT"); GET /DATA_String/{send_num = $send_num}HTTP/1.1 host connection user-agent EOT sleep 5; }