http://www.perlmonks.org?node_id=1059926

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

I'm trying to write a curses-based application to run under Linux. Can anyone suggest more curses-based Perl applications aside from the ones I found on CPAN and listed below? Seems like there are not too many of these, which is quite disappointing.

All of the above use Curses::UI, the most popular module used to build curses-based application. The other one, Curses::Toolkit, is newer and claims to be the modern alternative but is still in beta and doesn't have as many examples/documentation/widgets. Yet another one, Cdk (Curses-Devkit) while still on CPAN/Debian is long dead, fails on CPANTesters, and no other CPAN modules are using it.

In fact the whole situation with curses and Perl doesn't look too convincing. Lots of things don't seem to work or are buggy. Curses::UI::Grid's demo shows UI defects and spew substr() warnings. In the Curses::UI demo for multilanguage languages like Chinese don't work (my terminal & environment does support Chinese). The colors look atrocious. The demos for Curses::Toolkit look worse: Shift-Tab doesn't work, scroll area cannot be scrolled with keyboard, response to mouse clicks is slow (actually even typing into an input box feels very sluggish).

Should I just give up and look elsewhere for curses? Python seems to be used a lot by RedHat and Debian for this kind of tasks. I'm still trying to use Perl though. Perl is usually great at solving my problems, but for this I feel like I'm thrown *far before* the DOS/Turbo Pascal/Turbo Vision days. Why are we so backwards when it comes to TUI?

Update 2013-11-06: Someone mentioned Tickit on my blog, I actually bookmarked that module a few months ago but forgot about it. It does not use the curses library and looks quite promising. The code is quite clean and simple and modern, the author is active/maintaining, and it looks like it has quite a lot of features (multiple/overlapping windows, lots of widgets). But there is no application on CPAN using it yet.

Also someone reminded me about Inline::Python where you can in theory use many Python modules through Perl. I haven't explored this route further.

As I said also on the comment, dialog(1) is another simple alternative. Its form support is rather limited though.

Replies are listed 'Best First'.
Re: Curses-based applications?
by Anonymous Monk on Oct 28, 2013 at 07:17 UTC
      Thanks, I've tried several 'cme edit' commands like 'cme edit fstab'. Seems to work and decent enough. Although the app itself says "You should install Config::Model::TkUI for a more friendly user interface".
Re: Curses-based applications?
by sedusedan (Monk) on Oct 29, 2013 at 15:11 UTC

    Speaking of Turbo Vision, another option would be to turn to one of the Linux ports of it. Though one would have to write a Perl binding for it first. Python has Perl beat here by having a binding: PyTVision, but I suspect it's no longer working (last updated in 2004). Being an old and DOS-based project (it was first released by Borland in 1992), Turbo Vision probably has zero or near-zero support for Unicode/wide characters.

    I'm seriously considering dialog(1) now.