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

Oh wisests of programmers, this peasant has searched the great mountains of Google and the vast caverns of Teoma in search of a simple arrow or tab controlled Perl Menu that could work in an HPUX11 (UNIX) environment vt99 or vt100 emulation. Even the mightly halls of Orielly could not provide any wisdom. To make matters worse I'm working with I'm working with Perl5.0030 without any CGI.pm modules Can you help me on the road to menu bliss although use strict; require 6; and use diagnostics may not me an option here?

Replies are listed 'Best First'.
Re: Simple Arrow or Tab Controlled Menus
by Aristotle (Chancellor) on Jun 02, 2002 at 15:45 UTC
    I am not sure what you want to do - is it a CGI script? If so, then what you want is to learn HTML. If not, then either the Curses module or, alternatively, Curses::UI are probably what you are looking for.

    Makeshifts last the longest.

      And if it _is_ for a CGI script, then nanohurtz is going to have to resort to *shudder* JavaScript to get real time tab and arrow control ... i hate to say it, but vt emulation for a web page sounds like a job for a Java Applet or *shudder* *shudder* Flash. Time for me to say a thousand "Hail Larry"'s after giving that advice ...

      jeffa

      perl -e 'print "Hail Larry\n" x 1000'
Simple Arrow or Tab Controlled Menus
by nanohurtz (Initiate) on Jun 03, 2002 at 03:55 UTC
    Oh wisests of programmers, this humble servant will be using the perl driven menu in a telnet or emulated session like Exceed, Gnome generated xterm or telnet session. I have heard of Curses::UI and what it can do, unfortunately I cannot install this helpful component in my environment. I'm almost afraid that I may have to turn to a .sh solution, nay this believer does not want sin anymore. Is there a way I can do this in Perl without packaging it as a cgi?
Simple Arrow or Tab Controlled Menus
by nanohurtz (Initiate) on Jun 03, 2002 at 04:54 UTC
    I have been able to put together a simple .sh menu. How could I convert this into a tab or arrow controlled dream come true
    #! /bin/sh # nano's simple but non perl menu MY_ID=`id -u` NANO_HOME="$HOME/nanohurtz" MY_SAVE=`ls -1 $NANO_HOME/lib/save |grep -v .bak |grep ^$MY_ID` f_save() { cp $NANO_HOME/lib/save/$MY_SAVE $NANO_HOME/lib/save/$MY_SAVE.bak ls -l $NANO_HOME/lib/save/ echo -n -- ENTER -- read dummy f_nanohurtz } f_restore() { cp $NANO_HOME/lib/save/$MY_SAVE.bak $NANO_HOME/lib/save/$MY_SAVE ls -l $NANO_HOME/lib/save/ echo -n -- ENTER -- read dummy f_nanohurtz } f_menu() { tput clear cat << EOF nanohurtz interactive backup/restore menu (by none other than nanohurt +z) S) Save - Create a backup of current savefile R) Restore - Restore last saved file EOF echo -n "Prompt> " read _my_choice case "$_my_choice" in S|s) f_save ;; R|r) f_restore ;; esac } f_menu
Re: Simple Arrow or Tab Controlled Menus
by eclecticIO (Beadle) on Jul 18, 2002 at 04:24 UTC
       I realize this is a bit late, but I just ran across this node tonight. If you need arrow key navigation that works over telnet and you can install some extra software, I highly recommend dialog. It's an extremely easy use bit of software that lets you integrate a menu driven front end to any scripting language. You can read more about it at the Dialog Home Page

    From the webpage:
    " Dialog is a utility to create nice user interfaces to shell scripts, or other scripting languages, such as perl. It is non-graphical (it uses curses) so it can be run in the console or an xterm. There are also graphical Xwindows versions mentioned below."

       I can't describe how easy this is to use. It really is one of those things you have to play with to understand. Even if you can't use it on this project, you should download it and play with it just for fun. 'Cause you never know when you might need a menu driven script. Or maybe that's just me. :)