Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Low level socket question.

by crouchingpenguin (Priest)
on Jun 25, 2003 at 12:05 UTC ( #268822=note: print w/ replies, xml ) Need Help??


in reply to Low level socket question.

How about just using IO::Socket?

#!/usr/bin/perl $|++; use strict; use warnings; use IO::Socket; my $host = '0.0.0.0'; my $port = 80; my $socket = IO::Socket::INET->new( PeerHost => $host, PeerPort => $port, Timeout => 5, ) or die "Failed to connect to $host on $port: $!"; $socket->autoflush(1); print "Host reached\n-----------------\n" ; my $lines = 'GET /index.html'; $socket->send($lines . "\n"); while( defined( my $line = $socket->getline() ) ){ print $line; }

cp
----
"Never be afraid to try something new. Remember, amateurs built the ark. Professionals built the Titanic."


Comment on Re: Low level socket question.
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://268822]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (5)
As of 2015-07-04 19:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls