in reply to sql editor written in perl

> I have libarary Term::ReadKey;-- and nothing else

Why? If I were you I'd use Term::ReadLine instead of reinventing all with Term::ReadKey ...

> Any general advice on how to write/design this ?

... and "borrow" the editing concepts from the perldebugger °

update

°) or have a look at those 112 other dists depending on Term::ReadLine.

FWIW there is also a handful mentioning SQL. :)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery