Cmenu, Text Interfaces, and UTF8

Discussion in 'Perl' started by shade, Aug 11, 2003.

  1. shade

    shade Guest


    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

    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 on an HP-UX
    11.00 platform, I finally threw up my hands and am now developing on
    Linux (Redhat 9.0). 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

    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.
    shade, Aug 11, 2003
    1. Advertisements

  2. Guest

    (shade) wrote in message news:<>...
    > $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
    , Aug 11, 2003
    1. Advertisements

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
  2. Replies:
  3. Mark Anderson

    Writing to valid ANSI text file (UTF8 issue?)

    Mark Anderson, Sep 1, 2005, in forum: ASP General
    Mark Anderson
    Sep 1, 2005
  4. gry
    Alf P. Steinbach
    Mar 13, 2012
  5. Guest

    Text::Levenshtein and utf8 woes

    Guest, Mar 26, 2006, in forum: Perl Misc
    Mar 26, 2006

Share This Page