How to dispaly the content of a file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rellaboyina
    New Member
    • Jan 2007
    • 55

    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::Maketex t::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
    Code:
    package SSS;
    use lib '../lib/perl-5.8.3/lib/site_perl';
    use base Locale::Maketext;
    use Locale::Maketext::Lexicon {
    	'*' => [Gettext => '../abc/*.po'],
                    _auto => 1,
                  _style => 'gettext',
    };
    
    use strict;
    
    
    1;
    I use this module inside my CGI file as follows:

    program.cgi
    Code:
    (perl)
    
    use CGI;
    use SSS;
    
    my $q = new CGI();
    my $sf = pot::SF->new; # pot::SF is a user-defined module
    
    my $lang_to_use = get_lang($q->http('Accept-language'), $sf->{LANGUAGES}) ;
    $lang_to_use = $sf->{LANG_DEFAULT} if (!defined($lang_to_use));
    my $lh = SSS->get_handle($lang_to_use);
    Once we get the file handle $lh for SSS.pm, how do we display the content of the file.

    Thanks in advance.
    Last edited by rellaboyina; Nov 7 '07, 07:12 AM. Reason: MIs typed
  • eWish
    Recognized Expert Contributor
    • Jul 2007
    • 973

    #2
    Have a look at Locale::Maketex t::Simple, it looks alot easier and the docs show how you print your data.

    Comment

    • rellaboyina
      New Member
      • Jan 2007
      • 55

      #3
      Originally posted by eWish
      Have a look at Locale::Maketex t::Simple, it looks alot easier and the docs show how you print your data.
      As I have to use Locale::Maketex t::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.

      Comment

      • KevinADC
        Recognized Expert Specialist
        • Jan 2007
        • 4092

        #4
        Is this school work?

        Comment

        • rellaboyina
          New Member
          • Jan 2007
          • 55

          #5
          Originally posted by KevinADC
          Is this school work?
          To be frank, an assignment given to me.

          Comment

          • eWish
            Recognized Expert Contributor
            • Jul 2007
            • 973

            #6
            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

            Comment

            • KevinADC
              Recognized Expert Specialist
              • Jan 2007
              • 4092

              #7
              Originally posted by rellaboyina
              To be frank, an assignment given to me.
              OK, but is it a school assingment?

              Comment

              • rellaboyina
                New Member
                • Jan 2007
                • 55

                #8
                Originally posted by KevinADC
                OK, but is it a school assingment?
                It's not a school assignemnt. It's some work assigned to me in my project.

                Comment

                • rellaboyina
                  New Member
                  • Jan 2007
                  • 55

                  #9
                  Originally posted by eWish
                  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.

                  Comment

                  Working...