in reply to How to call 4gl from Perl
Which 4gl is it? Is it PowerBuilder, Unify, Oracle Forms? What is the screen generation framework? Curses, X, some version of Windows?
You're going to have to give us a lot more information before any one of us can determine if we have knowledge to share.
There are tools to macrotize (I'm sure that's a word) input to various types of GUIs, but given my experience with 4gl's in the distant past (waaaaay distant past), and more recent experience with expect and various windows macro tools, the cleanest, most stable, and even possibly quickest way may be to dig into to the 4gl and develop a new screen that does exactly what you need.
Hope that helps,
Update Ah, you already said xterm. My apologies.