M
Martin Kissner
Hello group,
I am trying to use a script from the book "Networkprogramming with Perl"
by Lincoln D. Stein.
----
#!/usr/bin/perl
use warnings;
use strict;
use IO::Socket;
my $server = shift;
my $fh = IO::Socket::INET->new($server);
my $line = <$fh>;
print $line;
----
It is supposed to read the first line from a remote server's welcome
message.
% ./lgetr.pl wuarchive.wustl.edu:daytime
is supposed to output the current date of that server.
% ./lgetr.pl wuarchive.wustl.edu:ftp
should print the welcome message of the ftp service on
wuarchive.wustl.edu
% ./lgetr.pl mail.hotmail.com:smtp
should print the welcome message of the smtp-server on mail.motmail.com
and so on.
In my case the script hangs infinitely without any output.
I have even tried my local smtp server wuth the sam result.
What could be wrong?
Any help will be appreciated.
Regards
Martin
I am trying to use a script from the book "Networkprogramming with Perl"
by Lincoln D. Stein.
----
#!/usr/bin/perl
use warnings;
use strict;
use IO::Socket;
my $server = shift;
my $fh = IO::Socket::INET->new($server);
my $line = <$fh>;
print $line;
----
It is supposed to read the first line from a remote server's welcome
message.
% ./lgetr.pl wuarchive.wustl.edu:daytime
is supposed to output the current date of that server.
% ./lgetr.pl wuarchive.wustl.edu:ftp
should print the welcome message of the ftp service on
wuarchive.wustl.edu
% ./lgetr.pl mail.hotmail.com:smtp
should print the welcome message of the smtp-server on mail.motmail.com
and so on.
In my case the script hangs infinitely without any output.
I have even tried my local smtp server wuth the sam result.
What could be wrong?
Any help will be appreciated.
Regards
Martin