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

Hi,
How I can create the GUI-like program using Perl which can be accessed from unix shell account? Typical example would be vi,emacs. These are written in C/Lisp+C in my opinion. Just wondering if Perl based solution is possible.

Thank You,
artist

Replies are listed 'Best First'.
Re: GUI-like on Unix Shell
by sauoq (Abbot) on Jul 17, 2003 at 19:10 UTC

    Curses

    -sauoq
    "My two cents aren't worth a dime.";
    
      Curses is not in standard delivery perl...therefore anyone using his/her script would need to download the module. Is there any Curses or similar interface available that doesn't require additional modules?....or should we use ANSI escape codes, readline,etc. to have a nice text based interface without requiring extra modules?
        Is there any Curses or similar interface available that doesn't require additional modules?

        Why restrict yourself to only using the modules that come with Perl? What do you gain by doing this? CPAN modules are extraordinarily easy to install already and the ongoing work on Module::Build, Module::Install, PAR and the like will only make it even better. If the code is free, readily available and offers numerous advantages then why on earth would you not use it?

Re: GUI-like on Unix Shell
by Mr. Muskrat (Canon) on Jul 17, 2003 at 19:11 UTC
    Yes, a Perl based solution is possible. Look at the User Interfaces section of CPAN.
Re: GUI-like on Unix Shell
by Azhrarn (Friar) on Jul 17, 2003 at 19:15 UTC
    Well, the most common way that I know of would be to use Curses (Nonblocking!). If you're really masochistic, you can use Term::Cap (I believe Curses is just a friendly set of c libraries that manipulate the termcap stuff in a friendlier manner), which is in the perl core.

    Edit: Blech, curse my slow typing. :)

Re: GUI-like on Unix Shell
by gjb (Vicar) on Jul 17, 2003 at 19:28 UTC

    For some more sophisticated applications, you might want to have a look at Term::Clui.

    Hope this helps, -gjb-

(jeffa) Re: GUI-like on Unix Shell
by jeffa (Bishop) on Jul 17, 2003 at 19:10 UTC
    I haven't coded much with it, but what i have seen of Prima is really cool. I have no idea if it has all the capabilities of Tk/Tcl ... but the code looks much more Perlish.

    Also, Glade is a decent package. It allows you to code with Perl as well as C.

    Curses!!! you want Curses ... ;)

    jeffa

    L-LL-L--L-LL-L--L-LL-L--
    -R--R-RR-R--R-RR-R--R-RR
    B--B--B--B--B--B--B--B--
    H---H---H---H---H---H---
    (the triplet paradiddle with high-hat)
    
      Foiled again, eh Jeffa? ;)

      -Logan
      "What do I want? I'm an American. I want more."

Re: GUI-like on Unix Shell
by mvc (Scribe) on Jul 17, 2003 at 22:27 UTC

    Easy. Just use Gtk/Tk/Wx/Qt/etc. Then run an ASCII X session ;)

Re: GUI-like on Unix Shell
by Anonymous Monk on Jul 17, 2003 at 19:37 UTC
    Why settle for GUI-like?
    Why not use Tk?
      I think it's because access is via a shell account, so the idea is to have a nice text-based interface. (Possibly Perl::Tk could do this, but it seems like overkill.)
        The secret there is ssh -X ;). Nothing like X-forwarding to make things easy.
Re: GUI-like on Unix Shell
by castaway (Parson) on Jul 18, 2003 at 08:42 UTC