Cmenu, Text Interfaces, and UTF8

S

shade

Hello.

I am new to Perl and having a lot of trouble finding a terminal based
menuing system. Here's what I'm trying to do...

I'm coding a web application to assist with Unix systems
administration for my company. I've already writting most of the
application in PHP, PostgreSQL, and backend scripts running in the
POSIX Shell.

As I'm challenging myself to learn Perl, I'd like to convert some of
the PHP/Shell to Perl and learn a bit while I go. The web-based stuff
hasn't been too hard. I am able to get mod_perl running and have been
using CGI.pm.

However, some features of this app. are really better suited in a
shell environment. I.e. a menu based terminal session for junior
admins, etc. My thoughts were to use a Java applet SSH window
embedded in the browser to sort of 'glue' the text based stuff with
the web based stuff.

In checking for a Perl module that handles text menus on CPAN, I found
Cmenu. After trying for a long time to compile Curses.pm on an HP-UX
11.00 platform, I finally threw up my hands and am now developing on
Linux (Redhat 9.0). Curses.pm was difficult to install there. I
finally found a patch hidden within a Mandrake source RPM and applied
it to the one from CPAN, and wa la, it worked.

So, now I have Cmenu compiled and ready to go on a Linux platform. I
set up a basic script using it and it dies. It appears that Cmenu
doesn't support UTF8 encoding.

Ugh. The saga continues. I find a quick fix, setting the LANG
environment variables to eng_US before running the script. However,
this is done outside the script.

Here's where I'm at now. Is there a way to set the environment
variable, LANG, i n a shell script before calling Cmenu? Something
like:

$ENV{'LANG'}='en_US';
use Cmenu;
print $ENV{'LANG'};

....returns "en_US" but still creates an error.

Second question: am I going about all of this the right way? Is there
a text user interface more modern and supported than Cmenu? Should I
just try and run everything through HTTP and forget the TUI? My
apologies for the long email, I'm learning a lot but feel I'm chasing
my own tail here and getting nowhere.

Thanks for any help.
Tom.
 
N

nobull

$ENV{'LANG'}='en_US';
use Cmenu;
print $ENV{'LANG'};

use() is compile-time.

If you want $ENV{'LANG'}='en_US' to happen at compile time, before
Cmenu is loaded, you need to enclose the assignment in BEGIN{}.

This newsgroup does not exist (see FAQ). Please do not start threads
here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,904
Latest member
HealthyVisionsCBDPrice

Latest Threads

Top