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

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 = ''; 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; }

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

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://268822]
[MidLifeXis]: I have a user who has a lot of say on how some of our processes work that abhors significant blanks. Perhaps that is a part of it. A not-so-obvious "this space intentionally left blank" indicator.
[MidLifeXis]: On the back end, however, that doesn't mean that i have to use that value to indicate "undefined", no matter how much he thinks I should.
[stonecolddevin]: hey MidLifeXis, all

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (11)
As of 2017-01-20 19:18 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (176 votes). Check out past polls.