Commit | Line | Data |
---|---|---|
1 | #!/usr/bin/env perl | |
2 | use strict; | |
3 | use warnings; | |
4 | use IO::Socket::INET; | |
5 | ||
6 | my $sock = IO::Socket::INET->new('localhost:80'); | |
7 | print $sock "GET / HTTP/1.1\r\nHost: localhost\r\nConnection: close\r\n\r\n"; | |
8 | while(<$sock>) { | |
9 | print $_; | |
10 | STDOUT->flush; | |
11 | } | |
12 | ||
13 | $sock->close; | |
14 |