473,573 Members | 2,749 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Cmenu, Text Interfaces, and UTF8

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'}='e n_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.
Jul 19 '05 #1
1 2570
sh***@lore.cc (shade) wrote in message news:<a8******* *************** ****@posting.go ogle.com>...
$ENV{'LANG'}='e n_US';
use Cmenu;
print $ENV{'LANG'};


use() is compile-time.

If you want $ENV{'LANG'}='e n_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.
Jul 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2372
by: JJ | last post by:
Hi, I have a little, big, boring problem :) I have a utf8 txt file to import in a MySQL db, cause I must create a web-application in PHP for reading this information on-line. I have create a new DB in MYSQL 4.1.1a setting CHARACTER=utf8, then I have create a table t1 with character set utf8 and some fileds also with CHARACTER=utf8.
40
3188
by: Peter Row | last post by:
Hi all, Here is my problem: I have a SQL Server 2000 DB with various NVarChar, NText fields in its tables. For some stupid reason the data was inserted into these fields in UTF8 encoding. However when you retrieve these values into a dataset and ToString() them
4
11497
by: H Lee | last post by:
Hi, I'm an XML newbie, and not sure if this is the appropriate newsgroup to post my question, so feel free to suggest other newgroups where I should post this message if this is the case. I'm having issues using XmlTextWriter, saving it out to a file with UTF8 encoding, and seeing "dirty", or "human unreadable" characters show up *right...
0
858
by: paul | last post by:
Here is the setup to my problem. I created a menu item "ParPort" on the standard menu toobar that the MFC wizzard generates when you create an application. In the CMainFrame class I disable the menu item. In my view class I have a handler for a button. The idea is when the button is clicked the On_Command handler will reenable the menu...
2
1342
by: chaoy | last post by:
Hi, I created a user control as my site header. The user control consists a custom control, cmenu. I have tried using table to center the cmenu, and no luck. The cmenu just uses top=xxx, and completely ignore the table. Currently I am trying to danamically center cmenu by code based upon the client' screen resolution. However, the...
12
5856
by: Adam J. Schaff | last post by:
I am writing a quick program to edit a binary file that contains file paths (amongst other things). If I look at the files in notepad, they look like: <gibberish>file//g:\pathtofile1<gibberish>file//g:\pathtofile2<gibberish> etc. I want to remove the "g:\" from the file paths. I wrote a console app that successfully reads the file and...
1
4837
by: jrs_14618 | last post by:
Hello All, This post is essentially a reply a previous post/thread here on this mailing.database.myodbc group titled: MySQL 4.0, FULL-TEXT Indexing and Search Arabic Data, Unicode I was wondering if anybody has experienced the same issues
1
5349
by: Server Applications | last post by:
Hello I am trying to build a system where I can full-text index documents with UTF8 or UTF16 data using Oracle Text. I am doing the filtering in a third-party component outside the database, so the I dont need filtering in Oracle, but only indexing. If I put file references to the filtered files in the database and index these (using...
0
7746
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7668
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7986
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7736
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
8036
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5258
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3701
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3699
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
999
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.