473,408 Members | 2,477 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How to dispaly the content of a file

Dear All,

I want to display the content of a file which I will be exporting to the module Locale::Maketext::Lexicon. For example there is a file "/abc/cde.po" and I wan to access this file using the above module.

Please let me know how to display the content of the file where as I am using the CGI environment.

SSS.pm
Expand|Select|Wrap|Line Numbers
  1. package SSS;
  2. use lib '../lib/perl-5.8.3/lib/site_perl';
  3. use base Locale::Maketext;
  4. use Locale::Maketext::Lexicon {
  5.     '*' => [Gettext => '../abc/*.po'],
  6.                 _auto => 1,
  7.               _style => 'gettext',
  8. };
  9.  
  10. use strict;
  11.  
  12.  
  13. 1;
I use this module inside my CGI file as follows:

program.cgi
Expand|Select|Wrap|Line Numbers
  1. (perl)
  2.  
  3. use CGI;
  4. use SSS;
  5.  
  6. my $q = new CGI();
  7. my $sf = pot::SF->new; # pot::SF is a user-defined module
  8.  
  9. my $lang_to_use = get_lang($q->http('Accept-language'), $sf->{LANGUAGES}) ;
  10. $lang_to_use = $sf->{LANG_DEFAULT} if (!defined($lang_to_use));
  11. my $lh = SSS->get_handle($lang_to_use);
  12.  
Once we get the file handle $lh for SSS.pm, how do we display the content of the file.

Thanks in advance.
Nov 7 '07 #1
8 1324
eWish
971 Expert 512MB
Have a look at Locale::Maketext::Simple, it looks alot easier and the docs show how you print your data.
Nov 7 '07 #2
Have a look at Locale::Maketext::Simple, it looks alot easier and the docs show how you print your data.
As I have to use Locale::Maketext::Lexicon module only in my project , I want to display the content of the file using that module itself. Please let me know how we can display the content.
Nov 8 '07 #3
KevinADC
4,059 Expert 2GB
Is this school work?
Nov 8 '07 #4
Is this school work?
To be frank, an assignment given to me.
Nov 8 '07 #5
eWish
971 Expert 512MB
I have read the docs and more docs. I am still not sure. With that said, there is a sample script in located on this page. I suggest reading the entire page. It was interesting but still not completely clear.


--Kevin
Nov 8 '07 #6
KevinADC
4,059 Expert 2GB
To be frank, an assignment given to me.
OK, but is it a school assingment?
Nov 8 '07 #7
OK, but is it a school assingment?
It's not a school assignemnt. It's some work assigned to me in my project.
Nov 8 '07 #8
I have read the docs and more docs. I am still not sure. With that said, there is a sample script in located on this page. I suggest reading the entire page. It was interesting but still not completely clear.


--Kevin
Thanks alot Kevin for your suggestion. I will go through it and will let you know if I don't get an idea.
Nov 8 '07 #9

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Tjerk Wolterink | last post by:
Why o Why does a browser treat this xml file as an xhtml file. <!DOCTYPE xc:content > <xc:xcontent xmlns:xc="http://www.wolterinkwebdesign.com/xml/xcontent"...
1
by: hullyi | last post by:
i have 2 frames one is a header with a menu and the other one is for dispaly, i want that all the aspx forms will be displayed in that frame even if i use 'response.redirecty' action
1
by: natin | last post by:
Hi I have a stored procedure that returns null values. How can i display the null values in my repeater control. Is there a .Net function out there that i can use. Regards Natin
7
by: xkeops | last post by:
Thinking of creating a website, most of the pages will have a general toolbar menu, a content and a footer. The content will be the only one who's gonna change but the rest (header,footer) will...
5
by: Ted Ngo | last post by:
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { txtSource.Focus(); frmMain.Visible = true; divWait.Visible = false; btnsubmit.Visible = true;
0
by: sangitadeori | last post by:
Hai M Sangita,I m working with C#.Net on windows application,I want to know that suppose we are browsing through some folder using Opendialogbox,it is showing me only the path in the textbox.But I...
9
by: vsraot | last post by:
Hi, How to dispaly two dicimal points in java (Example 1) 5.70 Example 2) 561 but it should display as 561.00) Example1) Here I am able to display 5.7 but it should display as 5.70 Example...
0
by: ARCHANAA | last post by:
hi, i m using asp.net ,oracle10g. my os is windows xp . i m also using office 2003 . in my application i want to dispaly data from an excel file to datagrid in asp.net page send me an...
1
by: sunilkumar123 | last post by:
sir, i am getting problem to dispaly 10 rows at my page and the next 10 record at next page and if you want to come back to previous page
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
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...
0
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.