Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hi,
i would like to be able passing keystrokes to terminal using perl.
as simple example of what i'd like to do would be this in perl:

system 'links http://www.whatever.com';

now I'd like to perl to take over links and passing key strokes e.g. xterm.typekyes(<DOWN><10>) or xterm.typekyes(<SPACE>) etc (syntax is from Silk4Test lang) ...
is there any such possibility with perl?

thx,
mahdi

Replies are listed 'Best First'.
Re: how to control xterm with perl
by davidrw (Prior) on Sep 11, 2005 at 19:10 UTC
    I think you're looking for Expect ..

    "links http://www.whatever.com" ?? Did you mean "lynx http://www.whatever.com"? If so, you might be (depending on what you're doing) much better off using WWW::Mechanize instead of lynx/expect...
      'links' is a text based browser very similiar to 'lynx'.

      "Never take yourself too seriously, because everyone knows that fat birds dont fly" -FLC
      links was just example (and yes it's text based web browser alike lynx) ... in general i want to take over terminal using perl, Expect looks that it might do the trick, just emerging it , I'll give it a try