Hi Vrunda,
I've just re-read the message and noticed you're trying to use the POP
protocol. To do that you need to use port 110.
Before trying to do it with your script tho', try doing it directly by
calling the telnet program. If that doesn't work, your script won't stand a
chance.
For a full list of ports and services look at the services file on your box
(/etc/services on most unix systems \windows\services under windows.
Gary
On Friday 22 June 2001 4:39 pm, Prabhu, Vrunda P (UMC-Student) wrote:
> Gary:
> I used port 23 with the same outcome: read timed out.
>
> John Edwards (thanks very much John) suggested a document at :
> http://www.perlfect.com/articles/telnet.shtml
>
> which seems to be pretty good, an dmight have solutions.
> Vrunda
>
> -----Original Message-----
> From: Gary Stainburn
> To: Prabhu, Vrunda P (UMC-Student); '[EMAIL PROTECTED] '
> Sent: 6/22/01 10:31 AM
> Subject: Re: :Telnet
>
> Hi,
>
> why are you telnetting to port 80? That's the http port.
> To use telnet, use port 23, which I think is the default anyway.
>
> Gary
>
> On Friday 22 June 2001 4:07 pm, Prabhu, Vrunda P (UMC-Student) wrote:
> > I too have questions on the same topic - Net::Telnet. I tried the
> > following code: (I have deleted the hostname, username and passwd),
>
> and get
>
> > the error:
> >
> > read timed-out at ./teltry.cgi line 13
> >
> >
> >
> >
> > #!/usr/bin/perl
> >
> > my ($hostname, $line, $passwd, $pop, $username);
> >
> > $hostname="...";
> > $username="...";
> > $passwd="...";
> >
> > use Net::Telnet ();
> > $pop=new Net::Telnet (Telnetmode => 0);
> > $pop->open(Host => $hostname, Port =>80);
> >
> > $line= $pop->getline;
> > die $line unless $line=~/^\+OK/;
> > $pop->print("user $username");
> > $line = $pop->getline;
> > die $line unless $line =~/^\+OK/;
> > $pop->print("pass $passwd");
> > $line=$pop->getline;
> >
> > Thanks in advance for any and all suggestions. My aim is to be able
>
> to
>
> > telnet to a site, and once there work allow the user to work at the
>
> site,
>
> > till the time when the user might wish to telnet to another site. If
>
> the
>
> > second site is connected to the first, the program shoudl make an
>
> internal
>
> > check, and allow the user to telnet there without asking for his/her
> > username password again.
> > I as you see in the code above am at the very early stages of
>
> attempting to
>
> > connect to a remote site.
> >
> > Thanks again.
> > Vrunda
> >
> > -----Original Message-----
> > From: Tom Yarrish
> > To: [EMAIL PROTECTED]
> > Sent: 6/21/01 3:22 PM
> > Subject: Net::Telnet
> >
> > Hey all,
> > Okay, I'm playing with Net::Telnet, and I've gotten to the point where
>
> I
>
> > connect to the other machine. What I wanted to know is, can I run and
> > interact with a program just using the cmd() part of that module? Or
>
> do
>
> > I
> > need to use another module to do that. Basically what I'm going is
> > telnetting to a server, then running a program (perl scripts
>
> actually),
>
> > then feeding it some options, and then exiting out of the program.
>
> Sort
>
> > of like this (snipped)
> >
> > $session->cmd("/home/export/user/Xmenu.pl");
> > $session->cmd("2"); # This is fed to the Xmenu.pl program
> > $session->cmd("1"); # and this
> > $session->cmd("y"); # and this
> >
> > Thanks,
> > Tom
--
Gary Stainburn
This email does not contain private or confidential material as it
may be snooped on by interested government parties for unknown
and undisclosed purposes - Regulation of Investigatory Powers Act, 2000