Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Cmenu, Text Interfaces, and UTF8

Reply
Thread Tools

Cmenu, Text Interfaces, and UTF8

 
 
shade
Guest
Posts: n/a
 
      08-11-2003
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.
 
Reply With Quote
 
 
 
 
nobull@mail.com
Guest
Posts: n/a
 
      08-11-2003
http://www.velocityreviews.com/forums/(E-Mail Removed) (shade) wrote in message news:<(E-Mail Removed). com>...
> $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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
given char* utf8, how to read unicode line by line, and output utf8 gry C++ 2 03-13-2012 04:32 AM
Problem Converting Word to UTF8 Text File patrick.waldo@gmail.com Python 4 10-22-2007 04:57 PM
Displaying utf8 text in perl -d lbova99@yahoo.com Perl Misc 1 09-15-2007 09:17 AM
Text::Levenshtein and utf8 woes Perl Misc 3 03-26-2006 05:40 PM
Writing to valid ANSI text file (UTF8 issue?) Mark Anderson ASP General 2 09-01-2005 07:00 PM



Advertisments