docs
[mirrors/Programs.git] / perl / socket.pl
CommitLineData
21c4e167
H
1#!/usr/bin/env perl
2use strict;
3use warnings;
4use IO::Socket::INET;
5
6my $sock = IO::Socket::INET->new('localhost:80');
7print $sock "GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n";
8while(<$sock>) {
9 print $_;
10 STDOUT->flush;
11}
12
13$sock->close;
14
This page took 0.144969 seconds and 4 git commands to generate.