Cmenu, Text Interfaces, and UTF8

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

  1. shade

    shade Guest

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

  2. shade

    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
    here.
     
    , Aug 11, 2003
    #2
    1. Advertising

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
    Views:
    396
  2. Replies:
    4
    Views:
    1,726
  3. Mark Anderson

    Writing to valid ANSI text file (UTF8 issue?)

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

    Text::Levenshtein and utf8 woes

    Guest, Mar 26, 2006, in forum: Perl Misc
    Replies:
    3
    Views:
    258
    Guest
    Mar 26, 2006
Loading...

Share This Page