Help for this page

Select Code to Download


  1. or download this
    use IO::Socket;
    
    ...
    my $fh     = IO::Socket::INET->new($server);
    my $line   = <$fh>;
    print $line;
    
  2. or download this
    % perl lgetr.pl mail.hotmail.com:smtp
    220 mc5-f26.hotmail.com Sending unsolicited commercial or bulk e-mail 
    +to Microsoft's computer network is prohibited. Other restrictions are
    + found at http://privacy.msn.com/Anti-spam/. Violations will result i
    +n use of equipment located in California and other states. Sat, 30 Ap
    +r 2005 19:25:12 -0700
    
  3. or download this
    my $fh = IO::Socket::INET->new($server) or die "Socket open failed: $^
    +E\n";
    
  4. or download this
    % perl lgetr.pl wuarchive.wustl.edu:daytime
    Socket open failed: Connection refused
    
  5. or download this
    use IO::Socket;
    
    ...
    % perl lgetr.pl[HIT RETURN HERE]
    mail.hotmail.com:smtp[HIT RETURN HERE]
    220 mc5-f26.hotmail.com Sending unsolicited commercial or bulk e-mail 
    +to Microsoft's computer network is prohibited. Other restrictions are
    + found at http://privacy.msn.com/Anti-spam/. Violations will result i
    +n use of equipment located in California and other states. Sat, 30 Ap
    +r 2005 19:28:52 -0700