Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Re: Telnet via Perl fails

by shamala (Acolyte)
on May 22, 2004 at 07:25 UTC ( [id://355558]=note: print w/replies, xml ) Need Help??


in reply to Re: Telnet via Perl fails
in thread Telnet via Perl fails

got some help on this...sharing it with you.

my friend says we should try duping the descriptors so

that the forked process containing the telnet command

can be controlled by us...pass the rest of the commands

starting from line7 to the duped descriptor which takes input from STDIN

but me doesnt know how to work with descriptors

will do some R&D on it today

u could try it out too..;)

and ofcourse let me know abt it

thanks a lot

shamala

Replies are listed 'Best First'.
Re: Re: Re: Telnet via Perl fails
by bart (Canon) on May 22, 2004 at 09:09 UTC
Re: Re: Re: Telnet via Perl fails
by jepri (Parson) on May 22, 2004 at 08:31 UTC
    No, I won't do your work for you.

    And if you keep listening to your friend rather than reading the manual (perlipc), you'll waste a lot of time. But that's your problem, not mine.

    ____________________
    Jeremy
    I didn't believe in evil until I dated it.

      oh no..i definitely dont want you to do my work...and abt the problem its only if you did my work for me... thanks anyways.
        Shamala,

        Listen to Jeremy. Here is what he is saying... your perl program is starting another program (in this case "telnet"). As long as telnet will run, your perl script will go into a waiting mode. None of the subsequent commands will be run. When telnet quits, you will get what one always gets whenever a perl command is run... either the value of the last expression evaluated, or a 0 (in case of failure) or a 1 (in case of success. So, either telnet is going to fail, and then your script will fail (unless you wrap telnet inside an eval block), or telnet will succeed, end, and return 1. Either way, your objective is not served.

        Listen to Jeremy. Read the advised manual and try and understand how perl can be used to actually either completely replace telnet, or work with other programs.

        Hope this helps you.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-04-19 23:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found