[comp.lang.perl] Scripting a TELNET session

fuchs@tsar.Princeton.EDU (Ira Fuchs) (07/06/90)

I am looking for a way to "Script" a TELNET session (and less importantly,
a TIP session). That is, I want to be able to write a script which will 
read data received and send data based on it (and other variables). Ideally
I would like to use an existing language such as PERL, REXX, SNOBOL, etc.
Has anyone ever developed the hooks to permit this?

emv@math.lsa.umich.edu (Edward Vielmetti) (07/07/90)

[scripted telnet]

Try "expect" from Don Libes, announced somewhere and reposted to
comp.archives just a few days ago.  ftp'able from durer.cme.nist.gov.
The embedded language is John Ousterhout's Tcl, which you need to pick
up separately.  

Tcl is not perl, but it may be enough of a language to do your job.

The other alternative for telnet at least is to use the socket
interface to make the connection to the remote host.  A disadvantage
here is that a plain old socket doesn't do all of the IAC
DO/DONT/WILL/WONT stuff that a proper Telnet does, you may be able to
cope regardless.  Perl will do that for you, & I was able to glue
together a simple NNTP client with it.  Certainly something to
navigate through command prompts is doable.

--Ed

Edward Vielmetti, U of Michigan math dept <emv@math.lsa.umich.edu>
comp.archives moderator